From d11f44f6d1ed2cf314c4665742f853193ae27354 Mon Sep 17 00:00:00 2001 From: Sujit Nirmal Date: Mon, 19 Oct 2026 20:36:14 +0000 Subject: [PATCH] [pycocotools] Accept lists of RLEs in mask.decode, area and toBbox --- stubs/pycocotools/pycocotools/mask.pyi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stubs/pycocotools/pycocotools/mask.pyi b/stubs/pycocotools/pycocotools/mask.pyi index 84e85c3bf215..7d92f2863ec4 100644 --- a/stubs/pycocotools/pycocotools/mask.pyi +++ b/stubs/pycocotools/pycocotools/mask.pyi @@ -24,6 +24,11 @@ def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: def frPyObjects(pyobj: list[int] | _EncodedRLE, h: int, w: int) -> _EncodedRLE: ... def encode(bimask: _NDArrayUInt8) -> _EncodedRLE: ... -def decode(rleObjs: _EncodedRLE) -> _NDArrayUInt8: ... +def decode(rleObjs: _EncodedRLE | list[_EncodedRLE]) -> _NDArrayUInt8: ... + +@overload def area(rleObjs: _EncodedRLE) -> _NPUInt32: ... -def toBbox(rleObjs: _EncodedRLE) -> _NDArrayFloat64: ... +@overload +def area(rleObjs: list[_EncodedRLE]) -> _NDArrayUInt32: ... + +def toBbox(rleObjs: _EncodedRLE | list[_EncodedRLE]) -> _NDArrayFloat64: ...