Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/sam3_image.py

Differential Revision: D105340230

fbshipit-source-id: ecb32f6146dcff7e16dd184f2e54c57897923bc3
This commit is contained in:
generatedunixname1401739305002972
2026-05-23 08:49:56 -07:00
committed by meta-codesync[bot]
parent 2814fa6194
commit 8e451d5eb4
+16 -16
View File
@@ -211,12 +211,12 @@ class Sam3Image(torch.nn.Module):
def _run_encoder( def _run_encoder(
self, self,
backbone_out, backbone_out: Dict,
find_input, find_input: FindStage,
prompt, prompt: torch.Tensor,
prompt_mask, prompt_mask: torch.Tensor,
encoder_extra_kwargs: Optional[Dict] = None, encoder_extra_kwargs: Optional[Dict] = None,
): ) -> Tuple[Dict, Dict, Tuple]:
feat_tuple = self._get_img_feats(backbone_out, find_input.img_ids) feat_tuple = self._get_img_feats(backbone_out, find_input.img_ids)
backbone_out, img_feats, img_pos_embeds, vis_feat_sizes = feat_tuple backbone_out, img_feats, img_pos_embeds, vis_feat_sizes = feat_tuple
@@ -725,22 +725,22 @@ class Sam3ImageOnVideoMultiGPU(Sam3Image):
def forward_video_grounding_multigpu( def forward_video_grounding_multigpu(
self, self,
backbone_out, backbone_out: Dict,
find_inputs, find_inputs: List,
geometric_prompt: Prompt, geometric_prompt: Prompt,
frame_idx, frame_idx: int,
num_frames, num_frames: int,
# `multigpu_buffer` is a dict to cache detector's outputs in a chunk between different calls # `multigpu_buffer` is a dict to cache detector's outputs in a chunk between different calls
multigpu_buffer, multigpu_buffer: Dict,
track_in_reverse=False, track_in_reverse: bool = False,
# whether to also return the SAM2 backbone features # whether to also return the SAM2 backbone features
return_sam2_backbone_feats=False, return_sam2_backbone_feats: bool = False,
# whether to perform NMS and suppress the scores of those detections removed by NMS # whether to perform NMS and suppress the scores of those detections removed by NMS
run_nms=False, run_nms: bool = False,
nms_prob_thresh=None, nms_prob_thresh: Optional[float] = None,
nms_iou_thresh=None, nms_iou_thresh: Optional[float] = None,
**kwargs, **kwargs,
): ) -> Tuple[Dict, Dict]:
""" """
Compute the detector's detection outputs in a distributed manner, where all GPUs process Compute the detector's detection outputs in a distributed manner, where all GPUs process
a chunk of frames (equal to the number of GPUs) at once and store them in cache. a chunk of frames (equal to the number of GPUs) at once and store them in cache.