From 4cbac146c1b5a1e3a7f5c6a894901090b4dfd65b Mon Sep 17 00:00:00 2001 From: generatedunixname1401739305002972 Date: Mon, 11 May 2026 07:06:53 -0700 Subject: [PATCH] Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py Differential Revision: D104644929 fbshipit-source-id: 53867910385982e0620979b9a46049fe4d02224d --- sam3/model/io_utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sam3/model/io_utils.py b/sam3/model/io_utils.py index 77ffbd1..2babaa5 100644 --- a/sam3/model/io_utils.py +++ b/sam3/model/io_utils.py @@ -442,7 +442,13 @@ class TorchCodecDecoder: which are not supported by `torchcodec.decoders.SimpleVideoDecoder` yet. """ - def __init__(self, source, dimension_order="NCHW", device="cpu", num_threads=1): + def __init__( + self, + source: Union[str, bytes], + dimension_order: str = "NCHW", + device: str = "cpu", + num_threads: int = 1, + ) -> None: from torchcodec import _core as core self._source = source # hold a reference to the source to prevent it from GC @@ -512,7 +518,7 @@ class FIFOLock: self._waiters.get() self._condition.notify_all() - def __enter__(self): + def __enter__(self) -> None: self.acquire() def __exit__(