Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions stubs/pycocotools/pycocotools/cocoeval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from .coco import COCO
_NDArray: TypeAlias = Incomplete
_TIOU: TypeAlias = Literal["segm", "bbox", "keypoints"]

class _EvaluationResult(TypedDict):
class _ImageEvaluationResult(TypedDict):
image_id: int
category_id: int
aRng: list[int]
Expand All @@ -27,10 +27,21 @@ class _EvaluationResult(TypedDict):
dtIgnore: _NDArray
# dtIgnore: npt.NDArray[np.float64]

class _EvaluationResult(TypedDict):
params: Params
counts: list[int]
date: str
# precision: npt.NDArray[np.float64]
precision: _NDArray
# recall: npt.NDArray[np.float64]
recall: _NDArray
# scores: npt.NDArray[np.float64]
scores: _NDArray

class COCOeval:
cocoGt: COCO
cocoDt: COCO
evalImgs: list[_EvaluationResult]
evalImgs: list[_ImageEvaluationResult]
eval: _EvaluationResult
params: Params
stats: _NDArray
Expand All @@ -41,7 +52,7 @@ class COCOeval:
def computeIoU(self, imgId: int, catId: int) -> list[float]: ...
def computeOks(self, imgId: int, catId: int) -> _NDArray: ...
# def computeOks(self, imgId: int, catId: int) -> npt.NDArray[np.float64]: ...
def evaluateImg(self, imgId: int, catId: int, aRng: list[int], maxDet: int) -> _EvaluationResult: ...
def evaluateImg(self, imgId: int, catId: int, aRng: list[int], maxDet: int) -> _ImageEvaluationResult: ...
def accumulate(self, p: Params | None = ...) -> None: ...
def summarize(self) -> None: ...

Expand All @@ -53,7 +64,7 @@ class Params:
recThrs: _NDArray
# recThrs: npt.NDArray[np.float64]
maxDets: list[int]
areaRng: list[int]
areaRng: list[list[float]]
areaRngLbl: list[str]
useCats: int
kpt_oks_sigmas: _NDArray
Expand Down