From 5ec0cd0330e98efbe08c9f68577cdf38b7cf80a0 Mon Sep 17 00:00:00 2001 From: Sujit Nirmal Date: Mon, 19 Oct 2026 20:34:15 +0000 Subject: [PATCH] [pycocotools] Accept in-memory results in COCO.loadRes --- stubs/pycocotools/pycocotools/coco.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/pycocotools/pycocotools/coco.pyi b/stubs/pycocotools/pycocotools/coco.pyi index 6e5af237bddb..60fc33c200d5 100644 --- a/stubs/pycocotools/pycocotools/coco.pyi +++ b/stubs/pycocotools/pycocotools/coco.pyi @@ -1,6 +1,6 @@ from collections.abc import Collection, Sequence from pathlib import Path -from typing import Generic, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only +from typing import Any, Generic, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only import numpy as np import numpy.typing as npt @@ -82,7 +82,7 @@ class COCO: 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 loadRes(self, resFile: str | npt.NDArray[np.float64] | list[dict[str, Any]]) -> COCO: ... def download(self, tarDir: str | None = None, imgIds: Collection[int] = []) -> Literal[-1] | None: ... def loadNumpyAnnotations(self, data: npt.NDArray[np.float64]) -> list[_Annotation]: ...