mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
[pycocotools] Fix COCOeval.eval and Params.areaRng (#9897)
* Rename `_EvaluationResult` to `_ImageEvaluationResult` * Add new `_EvaluationResult` * Fix type of `COCOeval.eval` * Correct Params.areaRng which is in fact a list of pairs
This commit is contained in:
@@ -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]
|
||||
@@ -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
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user