Add default values for third-party stubs beginning with 'P' (#9957)

This commit is contained in:
Alex Waygood
2023-03-27 18:58:53 +01:00
committed by GitHub
parent 20f9b3685d
commit 6fd7e36e80
248 changed files with 2181 additions and 2133 deletions

View File

@@ -62,26 +62,26 @@ class COCO:
imgs: dict[int, _Image]
imgToAnns: dict[int, list[_Annotation]]
catToImgs: dict[int, list[int]]
def __init__(self, annotation_file: str | Path | None = ...) -> None: ...
def __init__(self, annotation_file: str | Path | None = None) -> None: ...
def createIndex(self) -> None: ...
def info(self) -> None: ...
def getAnnIds(
self,
imgIds: Collection[int] | int = ...,
catIds: Collection[int] | int = ...,
areaRng: Sequence[float] = ...,
iscrowd: bool | None = ...,
imgIds: Collection[int] | int = [],
catIds: Collection[int] | int = [],
areaRng: Sequence[float] = [],
iscrowd: bool | None = None,
) -> list[int]: ...
def getCatIds(
self, catNms: Collection[str] | str = ..., supNms: Collection[str] | str = ..., catIds: Collection[int] | int = ...
self, catNms: Collection[str] | str = [], supNms: Collection[str] | str = [], catIds: Collection[int] | int = []
) -> list[int]: ...
def getImgIds(self, imgIds: Collection[int] | int = ..., catIds: list[int] | int = ...) -> list[int]: ...
def loadAnns(self, ids: Collection[int] | int = ...) -> list[_Annotation]: ...
def loadCats(self, ids: Collection[int] | int = ...) -> list[_Category]: ...
def loadImgs(self, ids: Collection[int] | int = ...) -> list[_Image]: ...
def showAnns(self, anns: Sequence[_Annotation], draw_bbox: bool = ...) -> None: ...
def getImgIds(self, imgIds: Collection[int] | int = [], catIds: list[int] | int = []) -> list[int]: ...
def loadAnns(self, ids: Collection[int] | int = []) -> list[_Annotation]: ...
def loadCats(self, ids: Collection[int] | int = []) -> list[_Category]: ...
def loadImgs(self, ids: Collection[int] | int = []) -> list[_Image]: ...
def showAnns(self, anns: Sequence[_Annotation], draw_bbox: bool = False) -> None: ...
def loadRes(self, resFile: str) -> COCO: ...
def download(self, tarDir: str | None = ..., imgIds: Collection[int] = ...) -> Literal[-1] | None: ...
def download(self, tarDir: str | None = None, imgIds: Collection[int] = []) -> Literal[-1] | None: ...
def loadNumpyAnnotations(self, data: _NDArray) -> list[_Annotation]: ...
# def loadNumpyAnnotations(self, data: npt.NDArray[np.float64]) -> list[_Annotation]: ...
@overload

View File

@@ -47,13 +47,13 @@ class COCOeval:
stats: _NDArray
# stats: npt.NDArray[np.float64]
ious: dict[tuple[int, int], list[float]]
def __init__(self, cocoGt: COCO | None = ..., cocoDt: COCO | None = ..., iouType: _TIOU = ...) -> None: ...
def __init__(self, cocoGt: COCO | None = None, cocoDt: COCO | None = None, iouType: _TIOU = "segm") -> None: ...
def evaluate(self) -> None: ...
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) -> _ImageEvaluationResult: ...
def accumulate(self, p: Params | None = ...) -> None: ...
def accumulate(self, p: Params | None = None) -> None: ...
def summarize(self) -> None: ...
class Params:
@@ -71,6 +71,6 @@ class Params:
# kpt_oks_sigmas: npt.NDArray[np.float64]
iouType: _TIOU
useSegm: int | None
def __init__(self, iouType: _TIOU = ...) -> None: ...
def __init__(self, iouType: _TIOU = "segm") -> None: ...
def setDetParams(self) -> None: ...
def setKpParams(self) -> None: ...