Skip to content

Commit

Permalink
Update cocoeval.py Literal error
Browse files Browse the repository at this point in the history
  • Loading branch information
MiXaiLL76 authored Sep 13, 2024
1 parent 5cdbda1 commit 0919ef9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions faster_coco_eval/core/cocoeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@

import logging
import os
import sys
from collections import defaultdict
from typing import Callable, List, Literal, Optional, Union
from typing import Callable, List, Optional, Union

if sys.version_info >= (3, 8):
from typing import Literal

iouTypeT = Literal["segm", "bbox", "keypoints", "boundary"]
else:
iouTypeT = str

import numpy as np

Expand All @@ -21,7 +29,7 @@ def __init__(
self,
cocoGt: Optional[COCO] = None,
cocoDt: Optional[COCO] = None,
iouType: Literal["segm", "bbox", "keypoints", "boundary"] = "segm",
iouType: iouTypeT = "segm",
print_function: Callable = logger.debug,
extra_calc: bool = False,
kpt_oks_sigmas: Optional[List[float]] = None,
Expand Down Expand Up @@ -653,7 +661,7 @@ def setKpParams(self):

def __init__(
self,
iouType: Literal["bbox", "keypoints", "segm", "boundary"] = "segm",
iouType: iouTypeT = "segm",
kpt_sigmas: Optional[List[float]] = None,
):
"""Params for coco evaluation api.
Expand Down

0 comments on commit 0919ef9

Please sign in to comment.