From 5f8e0647a147089f350f6b0feb03985f31cac94f Mon Sep 17 00:00:00 2001 From: generatedunixname1401739305002972 Date: Thu, 30 Apr 2026 10:01:09 -0700 Subject: [PATCH] Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py Differential Revision: D103174371 fbshipit-source-id: 3b418fc1689a3eee05cde64287a68ea02579f366 --- sam3/model/io_utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sam3/model/io_utils.py b/sam3/model/io_utils.py index 49eedfd..5813c26 100644 --- a/sam3/model/io_utils.py +++ b/sam3/model/io_utils.py @@ -93,12 +93,12 @@ def load_resource_as_video_frames( def load_image_as_single_frame_video( - image_path, - image_size, - offload_video_to_cpu, - img_mean=(0.5, 0.5, 0.5), - img_std=(0.5, 0.5, 0.5), -): + image_path: str, + image_size: int, + offload_video_to_cpu: bool, + img_mean: tuple[float, float, float] = (0.5, 0.5, 0.5), + img_std: tuple[float, float, float] = (0.5, 0.5, 0.5), +) -> tuple[torch.Tensor, int, int]: """Load an image as a single-frame video.""" images, image_height, image_width = _load_img_as_tensor(image_path, image_size) images = images.unsqueeze(0).half() @@ -470,7 +470,7 @@ class TorchCodecDecoder: def __len__(self) -> int: return self._num_frames - def __getitem__(self, key: int): + def __getitem__(self, key: int) -> torch.Tensor: from torchcodec import _core as core if key < 0: