Skip to content

Commit 8e451d5

Browse files
generatedunixname1401739305002972meta-codesync[bot]
authored andcommitted
Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/sam3_image.py
Differential Revision: D105340230 fbshipit-source-id: ecb32f6146dcff7e16dd184f2e54c57897923bc3
1 parent 2814fa6 commit 8e451d5

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

sam3/model/sam3_image.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ def _encode_prompt(
211211

212212
def _run_encoder(
213213
self,
214-
backbone_out,
215-
find_input,
216-
prompt,
217-
prompt_mask,
214+
backbone_out: Dict,
215+
find_input: FindStage,
216+
prompt: torch.Tensor,
217+
prompt_mask: torch.Tensor,
218218
encoder_extra_kwargs: Optional[Dict] = None,
219-
):
219+
) -> Tuple[Dict, Dict, Tuple]:
220220
feat_tuple = self._get_img_feats(backbone_out, find_input.img_ids)
221221
backbone_out, img_feats, img_pos_embeds, vis_feat_sizes = feat_tuple
222222

@@ -725,22 +725,22 @@ def __init__(
725725

726726
def forward_video_grounding_multigpu(
727727
self,
728-
backbone_out,
729-
find_inputs,
728+
backbone_out: Dict,
729+
find_inputs: List,
730730
geometric_prompt: Prompt,
731-
frame_idx,
732-
num_frames,
731+
frame_idx: int,
732+
num_frames: int,
733733
# `multigpu_buffer` is a dict to cache detector's outputs in a chunk between different calls
734-
multigpu_buffer,
735-
track_in_reverse=False,
734+
multigpu_buffer: Dict,
735+
track_in_reverse: bool = False,
736736
# whether to also return the SAM2 backbone features
737-
return_sam2_backbone_feats=False,
737+
return_sam2_backbone_feats: bool = False,
738738
# whether to perform NMS and suppress the scores of those detections removed by NMS
739-
run_nms=False,
740-
nms_prob_thresh=None,
741-
nms_iou_thresh=None,
739+
run_nms: bool = False,
740+
nms_prob_thresh: Optional[float] = None,
741+
nms_iou_thresh: Optional[float] = None,
742742
**kwargs,
743-
):
743+
) -> Tuple[Dict, Dict]:
744744
"""
745745
Compute the detector's detection outputs in a distributed manner, where all GPUs process
746746
a chunk of frames (equal to the number of GPUs) at once and store them in cache.

0 commit comments

Comments
 (0)