SYMBOL INDEX (1745 symbols across 133 files) FILE: sam3/agent/agent_core.py function save_debug_messages (line 17) | def save_debug_messages(messages_list, debug, debug_folder_path, debug_j... function cleanup_debug_files (line 27) | def cleanup_debug_files(debug, debug_folder_path, debug_jsonl_path): function count_images (line 39) | def count_images(messages): function _prune_messages_for_next_round (line 56) | def _prune_messages_for_next_round( function agent_inference (line 124) | def agent_inference( FILE: sam3/agent/client_llm.py function get_image_base64_and_mime (line 12) | def get_image_base64_and_mime(image_path): function send_generate_request (line 36) | def send_generate_request( function send_direct_request (line 130) | def send_direct_request( FILE: sam3/agent/client_sam3.py function sam3_inference (line 17) | def sam3_inference(processor, image_path, text_prompt): function call_sam_service (line 51) | def call_sam_service( FILE: sam3/agent/helpers/boxes.py class BoxMode (line 17) | class BoxMode(IntEnum): method convert (line 48) | def convert( class Boxes (line 139) | class Boxes: method __init__ (line 151) | def __init__(self, tensor: torch.Tensor): method clone (line 170) | def clone(self) -> "Boxes": method to (line 179) | def to(self, device: torch.device): method area (line 183) | def area(self) -> torch.Tensor: method clip (line 194) | def clip(self, box_size: Tuple[int, int]) -> None: method nonempty (line 210) | def nonempty(self, threshold: float = 0.0) -> torch.Tensor: method __getitem__ (line 226) | def __getitem__(self, item) -> "Boxes": method __len__ (line 252) | def __len__(self) -> int: method __repr__ (line 255) | def __repr__(self) -> str: method inside_box (line 258) | def inside_box( method get_centers (line 279) | def get_centers(self) -> torch.Tensor: method scale (line 286) | def scale(self, scale_x: float, scale_y: float) -> None: method cat (line 294) | def cat(cls, boxes_list: List["Boxes"]) -> "Boxes": method device (line 314) | def device(self) -> device: method __iter__ (line 320) | def __iter__(self): function pairwise_intersection (line 327) | def pairwise_intersection(boxes1: Boxes, boxes2: Boxes) -> torch.Tensor: function pairwise_iou (line 351) | def pairwise_iou(boxes1: Boxes, boxes2: Boxes) -> torch.Tensor: function pairwise_ioa (line 376) | def pairwise_ioa(boxes1: Boxes, boxes2: Boxes) -> torch.Tensor: function pairwise_point_box_distance (line 396) | def pairwise_point_box_distance(points: torch.Tensor, boxes: Boxes): function matched_pairwise_iou (line 415) | def matched_pairwise_iou(boxes1: Boxes, boxes2: Boxes) -> torch.Tensor: FILE: sam3/agent/helpers/color_map.py function colormap (line 90) | def colormap(rgb=False, maximum=255): function random_color (line 106) | def random_color(rgb=False, maximum=255): function random_colors (line 122) | def random_colors(N, rgb=False, maximum=255): FILE: sam3/agent/helpers/keypoints.py class Keypoints (line 12) | class Keypoints: method __init__ (line 25) | def __init__(self, keypoints: Union[torch.Tensor, np.ndarray, List[Lis... method __len__ (line 41) | def __len__(self) -> int: method to (line 44) | def to(self, *args: Any, **kwargs: Any) -> "Keypoints": method device (line 48) | def device(self) -> torch.device: method to_heatmap (line 51) | def to_heatmap(self, boxes: torch.Tensor, heatmap_size: int) -> torch.... method __getitem__ (line 68) | def __getitem__(self, item: Union[int, slice, torch.BoolTensor]) -> "K... method __repr__ (line 86) | def __repr__(self) -> str: method cat (line 92) | def cat(keypoints_list: List["Keypoints"]) -> "Keypoints": function _keypoints_to_heatmap (line 112) | def _keypoints_to_heatmap( function heatmaps_to_keypoints (line 172) | def heatmaps_to_keypoints(maps: torch.Tensor, rois: torch.Tensor) -> tor... FILE: sam3/agent/helpers/mask_overlap_removal.py function mask_intersection (line 16) | def mask_intersection( function mask_iom (line 32) | def mask_iom(masks1: torch.Tensor, masks2: torch.Tensor) -> torch.Tensor: function _decode_single_mask (line 42) | def _decode_single_mask(mask_repr, h: int, w: int) -> np.ndarray: function _decode_masks_to_torch_bool (line 67) | def _decode_masks_to_torch_bool(pred_masks: List, h: int, w: int) -> tor... function remove_overlapping_masks (line 73) | def remove_overlapping_masks(sample: Dict, iom_thresh: float = 0.3) -> D... FILE: sam3/agent/helpers/masks.py function polygon_area (line 19) | def polygon_area(x, y): function polygons_to_bitmask (line 25) | def polygons_to_bitmask( function rasterize_polygons_within_box (line 44) | def rasterize_polygons_within_box( class BitMasks (line 93) | class BitMasks: method __init__ (line 102) | def __init__(self, tensor: Union[torch.Tensor, np.ndarray]): method to (line 118) | def to(self, *args: Any, **kwargs: Any) -> "BitMasks": method device (line 122) | def device(self) -> torch.device: method __getitem__ (line 126) | def __getitem__(self, item: Union[int, slice, torch.BoolTensor]) -> "B... method __iter__ (line 152) | def __iter__(self) -> torch.Tensor: method __repr__ (line 156) | def __repr__(self) -> str: method __len__ (line 161) | def __len__(self) -> int: method nonempty (line 164) | def nonempty(self) -> torch.Tensor: method from_polygon_masks (line 175) | def from_polygon_masks( method from_roi_masks (line 194) | def from_roi_masks(roi_masks: "ROIMasks", height: int, width: int) -> ... method crop_and_resize (line 202) | def crop_and_resize(self, boxes: torch.Tensor, mask_size: int) -> torc... method get_bounding_boxes (line 237) | def get_bounding_boxes(self) -> Boxes: method cat (line 256) | def cat(bitmasks_list: List["BitMasks"]) -> "BitMasks": class PolygonMasks (line 276) | class PolygonMasks: method __init__ (line 284) | def __init__(self, polygons: List[List[Union[torch.Tensor, np.ndarray]... method to (line 331) | def to(self, *args: Any, **kwargs: Any) -> "PolygonMasks": method device (line 335) | def device(self) -> torch.device: method get_bounding_boxes (line 338) | def get_bounding_boxes(self) -> Boxes: method nonempty (line 355) | def nonempty(self) -> torch.Tensor: method __getitem__ (line 366) | def __getitem__( method __iter__ (line 400) | def __iter__(self) -> Iterator[List[np.ndarray]]: method __repr__ (line 408) | def __repr__(self) -> str: method __len__ (line 413) | def __len__(self) -> int: method crop_and_resize (line 416) | def crop_and_resize(self, boxes: torch.Tensor, mask_size: int) -> torc... method area (line 448) | def area(self): method cat (line 468) | def cat(polymasks_list: List["PolygonMasks"]) -> "PolygonMasks": class ROIMasks (line 488) | class ROIMasks: method __init__ (line 495) | def __init__(self, tensor: torch.Tensor): method to (line 504) | def to(self, device: torch.device) -> "ROIMasks": method device (line 508) | def device(self) -> device: method __len__ (line 511) | def __len__(self): method __getitem__ (line 514) | def __getitem__(self, item) -> "ROIMasks": method __repr__ (line 536) | def __repr__(self) -> str: method to_bitmasks (line 542) | def to_bitmasks(self, boxes: torch.Tensor, height, width, threshold=0.5): FILE: sam3/agent/helpers/memory.py function _ignore_torch_cuda_oom (line 15) | def _ignore_torch_cuda_oom(): function retry_if_cuda_oom (line 29) | def retry_if_cuda_oom(func): FILE: sam3/agent/helpers/rle.py function rle_encode (line 13) | def rle_encode(orig_mask, return_areas=False): function robust_rle_encode (line 84) | def robust_rle_encode(masks): function ann_to_rle (line 105) | def ann_to_rle(segm, im_info): FILE: sam3/agent/helpers/roi_align.py class ROIAlign (line 10) | class ROIAlign(nn.Module): method __init__ (line 11) | def __init__(self, output_size, spatial_scale, sampling_ratio, aligned... method forward (line 52) | def forward(self, input, rois): method __repr__ (line 70) | def __repr__(self): FILE: sam3/agent/helpers/rotated_boxes.py function pairwise_iou_rotated (line 17) | def pairwise_iou_rotated(boxes1, boxes2): class RotatedBoxes (line 35) | class RotatedBoxes(Boxes): method __init__ (line 44) | def __init__(self, tensor: torch.Tensor): method clone (line 249) | def clone(self) -> "RotatedBoxes": method to (line 258) | def to(self, device: torch.device, non_blocking: bool = False): method area (line 262) | def area(self) -> torch.Tensor: method normalize_angles (line 274) | def normalize_angles(self) -> None: method clip (line 281) | def clip( method nonempty (line 333) | def nonempty(self, threshold: float = 0.0) -> torch.Tensor: method __getitem__ (line 348) | def __getitem__(self, item) -> "RotatedBoxes": method __len__ (line 371) | def __len__(self) -> int: method __repr__ (line 374) | def __repr__(self) -> str: method inside_box (line 377) | def inside_box( method get_centers (line 416) | def get_centers(self) -> torch.Tensor: method scale (line 423) | def scale(self, scale_x: float, scale_y: float) -> None: method cat (line 489) | def cat(cls, boxes_list: List["RotatedBoxes"]) -> "RotatedBoxes": method device (line 509) | def device(self) -> torch.device: method __iter__ (line 513) | def __iter__(self): function pairwise_iou (line 520) | def pairwise_iou(boxes1: RotatedBoxes, boxes2: RotatedBoxes) -> None: FILE: sam3/agent/helpers/som_utils.py function rgb_to_hex (line 16) | def rgb_to_hex(rgb_color): function _validate_color_hex (line 78) | def _validate_color_hex(color_hex: str): class Color (line 88) | class Color: method from_hex (line 103) | def from_hex(cls, color_hex: str): method to_hex (line 127) | def to_hex(cls, color): method as_rgb (line 139) | def as_rgb(self) -> Tuple[int, int, int]: method as_bgr (line 154) | def as_bgr(self) -> Tuple[int, int, int]: method white (line 170) | def white(cls): method black (line 174) | def black(cls): method red (line 178) | def red(cls): method green (line 182) | def green(cls): method blue (line 186) | def blue(cls): class ColorPalette (line 191) | class ColorPalette: method default (line 195) | def default(cls): method from_hex (line 211) | def from_hex(cls, color_hex_list: List[str]): method by_idx (line 230) | def by_idx(self, idx: int) -> Color: method find_farthest_color (line 251) | def find_farthest_color(self, img_array): function draw_box (line 289) | def draw_box(ax, box_coord, alpha=0.8, edge_color="g", line_style="-", l... function draw_text (line 305) | def draw_text( function draw_mask (line 335) | def draw_mask( function _change_color_brightness (line 383) | def _change_color_brightness(color, brightness_factor): FILE: sam3/agent/helpers/visualizer.py class ColorMode (line 44) | class ColorMode(Enum): class GenericMask (line 66) | class GenericMask: method __init__ (line 74) | def __init__(self, mask_or_polygons, height, width): method mask (line 108) | def mask(self): method polygons (line 114) | def polygons(self): method has_holes (line 120) | def has_holes(self): method mask_to_polygons (line 130) | def mask_to_polygons(self, mask): method polygons_to_mask (line 153) | def polygons_to_mask(self, polygons): method area (line 158) | def area(self): method bbox (line 161) | def bbox(self): class _PanopticPrediction (line 170) | class _PanopticPrediction: method __init__ (line 175) | def __init__(self, panoptic_seg, segments_info, metadata=None): method non_empty_mask (line 213) | def non_empty_mask(self): method semantic_masks (line 229) | def semantic_masks(self): method instance_masks (line 237) | def instance_masks(self): function _create_text_labels (line 247) | def _create_text_labels(classes, scores, class_names, is_crowd=None): class VisImage (line 274) | class VisImage: method __init__ (line 275) | def __init__(self, img, scale=1.0): method _setup_figure (line 286) | def _setup_figure(self, img): method reset_image (line 311) | def reset_image(self, img): method save (line 321) | def save(self, filepath): method get_image (line 329) | def get_image(self): class Visualizer (line 350) | class Visualizer: method __init__ (line 374) | def __init__( method draw_instance_predictions (line 418) | def draw_instance_predictions(self, predictions): method draw_sem_seg (line 494) | def draw_sem_seg(self, sem_seg, area_threshold=None, alpha=0.7): method draw_panoptic_seg (line 530) | def draw_panoptic_seg( method draw_dataset_dict (line 609) | def draw_dataset_dict(self, dic): method overlay_instances (line 686) | def overlay_instances( method overlay_rotated_instances (line 823) | def overlay_rotated_instances(self, boxes=None, labels=None, assigned_... method draw_and_connect_keypoints (line 865) | def draw_and_connect_keypoints(self, keypoints): method mask_dims_from_binary (line 927) | def mask_dims_from_binary(self, binary_mask): method reposition_label (line 935) | def reposition_label(self, position, cur, binary_mask, move_count): method locate_label_position (line 987) | def locate_label_position(self, original_position, added_positions, bi... method draw_text (line 1011) | def draw_text( method draw_box (line 1084) | def draw_box(self, box_coord, alpha=0.5, edge_color="g", line_style="-"): method draw_rotated_box_with_label (line 1118) | def draw_rotated_box_with_label( method draw_circle (line 1181) | def draw_circle(self, circle_coord, color, radius=3): method draw_line (line 1199) | def draw_line(self, x_data, y_data, color, linestyle="-", linewidth=No... method draw_binary_mask (line 1230) | def draw_binary_mask( method draw_binary_mask_with_number (line 1293) | def draw_binary_mask_with_number( method draw_soft_mask (line 1379) | def draw_soft_mask(self, soft_mask, color=None, *, text=None, alpha=0.5): method draw_polygon (line 1409) | def draw_polygon(self, segment, color, edge_color=None, alpha=0.5): method _jitter (line 1447) | def _jitter(self, color): method _create_grayscale_image (line 1467) | def _create_grayscale_image(self, mask=None): method _change_color_brightness (line 1478) | def _change_color_brightness(self, color, brightness_factor): method _convert_boxes (line 1505) | def _convert_boxes(self, boxes): method _convert_masks (line 1514) | def _convert_masks(self, masks_or_polygons): method _draw_number_in_box (line 1537) | def _draw_number_in_box(self, box, text, color, label_mode="1"): method number_to_string (line 1577) | def number_to_string(n): method _draw_number_in_mask (line 1584) | def _draw_number_in_mask( method _draw_text_in_mask (line 1630) | def _draw_text_in_mask(self, binary_mask, text, color): method _convert_keypoints (line 1651) | def _convert_keypoints(self, keypoints): method get_output (line 1657) | def get_output(self): FILE: sam3/agent/helpers/zoom_in.py function render_zoom_in (line 16) | def render_zoom_in( FILE: sam3/agent/inference.py function run_single_image_inference (line 11) | def run_single_image_inference( FILE: sam3/agent/viz.py function visualize (line 14) | def visualize( FILE: sam3/eval/cgf1_eval.py class Metric (line 23) | class Metric: class COCOCustom (line 63) | class COCOCustom(COCO): method createIndex (line 66) | def createIndex(self): method loadRes (line 102) | def loadRes(self, resFile): class CGF1Eval (line 181) | class CGF1Eval(COCOeval): method __init__ (line 194) | def __init__( method computeIoU (line 216) | def computeIoU(self, imgId, catId): method evaluateImg (line 242) | def evaluateImg(self, imgId, catId, aRng, maxDet): method accumulate (line 344) | def accumulate(self, p=None): method summarize (line 451) | def summarize(self): function _evaluate (line 504) | def _evaluate(self): class CGF1Evaluator (line 541) | class CGF1Evaluator: method __init__ (line 547) | def __init__( method evaluate (line 593) | def evaluate(self, pred_file: str): method _select_best_scoring (line 665) | def _select_best_scoring(scorings): FILE: sam3/eval/coco_eval.py class CocoEvaluator (line 40) | class CocoEvaluator: method __init__ (line 41) | def __init__( method _lazy_init (line 109) | def _lazy_init(self, coco_cls=COCO): method set_sync_device (line 157) | def set_sync_device(self, device: torch.device) -> Any: method _evaluate (line 160) | def _evaluate(self, *args, **kwargs): method _loadRes (line 163) | def _loadRes(self, *args, **kwargs): method update (line 166) | def update(self, *args, **kwargs): method select_best_scoring (line 199) | def select_best_scoring(self, scorings): method _dump (line 209) | def _dump(self, results): method synchronize_between_processes (line 220) | def synchronize_between_processes(self): method accumulate (line 251) | def accumulate(self, imgIds=None): method summarize (line 283) | def summarize(self): method compute_synced (line 347) | def compute_synced(self): method compute (line 352) | def compute(self): method reset (line 356) | def reset(self, cocoeval_cls=COCOeval): method write (line 388) | def write(self, stats): method prepare (line 397) | def prepare(self, predictions, iou_type): method prepare_for_coco_detection (line 408) | def prepare_for_coco_detection(self, predictions): method prepare_for_coco_segmentation (line 434) | def prepare_for_coco_segmentation(self, predictions): method prepare_for_coco_keypoint (line 489) | def prepare_for_coco_keypoint(self, predictions): function convert_to_xywh (line 517) | def convert_to_xywh(boxes): function merge (line 522) | def merge(img_ids, eval_imgs, gather_pred_via_filesys=False): function create_common_coco_eval (line 553) | def create_common_coco_eval( function segmentation_prepare (line 598) | def segmentation_prepare(self): function evaluate (line 630) | def evaluate(self, use_self_evaluate): function loadRes (line 737) | def loadRes(self, resFile): function summarize (line 810) | def summarize(self): function accumulate (line 893) | def accumulate(self, use_self_eval=False): FILE: sam3/eval/coco_eval_offline.py function convert_to_xywh (line 47) | def convert_to_xywh(boxes): class HeapElement (line 53) | class HeapElement: method __init__ (line 56) | def __init__(self, val): method __lt__ (line 59) | def __lt__(self, other): class COCOevalCustom (line 63) | class COCOevalCustom(COCOeval): method __init__ (line 68) | def __init__( method _prepare (line 74) | def _prepare(self): class CocoEvaluatorOfflineWithPredFileEvaluators (line 129) | class CocoEvaluatorOfflineWithPredFileEvaluators: method __init__ (line 130) | def __init__( method evaluate (line 142) | def evaluate(self, dumped_file): FILE: sam3/eval/coco_reindex.py function reindex_coco_to_temp (line 16) | def reindex_coco_to_temp(input_json_path: str) -> Optional[str]: function test_reindex_function (line 164) | def test_reindex_function(): FILE: sam3/eval/coco_writer.py class HeapElement (line 38) | class HeapElement: method __init__ (line 41) | def __init__(self, val): method __lt__ (line 44) | def __lt__(self, other): class PredictionDumper (line 48) | class PredictionDumper: method __init__ (line 56) | def __init__( method update (line 98) | def update(self, *args, **kwargs): method _dump (line 109) | def _dump(self, results): method synchronize_between_processes (line 123) | def synchronize_between_processes(self): method gather_and_merge_predictions (line 156) | def gather_and_merge_predictions(self): method compute_synced (line 205) | def compute_synced(self): method compute (line 226) | def compute(self): method reset (line 235) | def reset(self): method prepare (line 239) | def prepare(self, predictions, iou_type): method prepare_for_coco_detection (line 257) | def prepare_for_coco_detection(self, predictions): method prepare_for_coco_segmentation (line 292) | def prepare_for_coco_segmentation(self, predictions): FILE: sam3/eval/conversion_util.py function convert_ytbvis_to_cocovid_gt (line 11) | def convert_ytbvis_to_cocovid_gt(ann_json, save_path=None): function convert_ytbvis_to_cocovid_pred (line 121) | def convert_ytbvis_to_cocovid_pred( FILE: sam3/eval/demo_eval.py class DemoEval (line 22) | class DemoEval(COCOeval): method __init__ (line 28) | def __init__( method computeIoU (line 52) | def computeIoU(self, imgId, catId): method evaluateImg (line 78) | def evaluateImg(self, imgId, catId, aRng, maxDet): method accumulate (line 201) | def accumulate(self, p=None): method summarize (line 342) | def summarize(self): class DemoEvaluator (line 483) | class DemoEvaluator(CocoEvaluator): method __init__ (line 484) | def __init__( method _lazy_init (line 516) | def _lazy_init(self): method select_best_scoring (line 523) | def select_best_scoring(self, scorings): method summarize (line 565) | def summarize(self): method accumulate (line 629) | def accumulate(self, imgIds=None): method reset (line 644) | def reset(self): FILE: sam3/eval/hota_eval_toolkit/run_ytvis_eval.py function run_ytvis_eval (line 48) | def run_ytvis_eval(args=None, gt_json=None, dt_json=None): FILE: sam3/eval/hota_eval_toolkit/trackeval/_timing.py function time (line 15) | def time(f): FILE: sam3/eval/hota_eval_toolkit/trackeval/datasets/_base_dataset.py class _BaseDataset (line 19) | class _BaseDataset(ABC): method __init__ (line 21) | def __init__(self): method get_default_dataset_config (line 34) | def get_default_dataset_config(): ... method _load_raw_file (line 37) | def _load_raw_file(self, tracker, seq, is_gt): ... method get_preprocessed_seq_data (line 41) | def get_preprocessed_seq_data(self, raw_data, cls): ... method _calculate_similarities (line 44) | def _calculate_similarities(self, gt_dets_t, tracker_dets_t): ... method get_class_name (line 49) | def get_class_name(cls): method get_name (line 52) | def get_name(self): method get_output_fol (line 55) | def get_output_fol(self, tracker): method get_display_name (line 58) | def get_display_name(self, tracker): method get_eval_info (line 64) | def get_eval_info(self): method get_raw_seq_data (line 69) | def get_raw_seq_data(self, tracker, seq): method _load_simple_text_file (line 109) | def _load_simple_text_file( method _calculate_mask_ious (line 246) | def _calculate_mask_ious(masks1, masks2, is_encoded=False, do_ioa=False): method _calculate_box_ious (line 283) | def _calculate_box_ious(bboxes1, bboxes2, box_format="xywh", do_ioa=Fa... method _calculate_euclidean_similarity (line 332) | def _calculate_euclidean_similarity(dets1, dets2, zero_distance=2.0): method _check_unique_ids (line 343) | def _check_unique_ids(data, after_preproc=False): FILE: sam3/eval/hota_eval_toolkit/trackeval/datasets/tao_ow.py class TAO_OW (line 18) | class TAO_OW(_BaseDataset): method get_default_dataset_config (line 22) | def get_default_dataset_config(): method __init__ (line 45) | def __init__(self, config=None): method get_display_name (line 205) | def get_display_name(self, tracker): method _load_raw_file (line 208) | def _load_raw_file(self, tracker, seq, is_gt): method get_preprocessed_seq_data (line 362) | def get_preprocessed_seq_data(self, raw_data, cls): method _calculate_similarities (line 519) | def _calculate_similarities(self, gt_dets_t, tracker_dets_t): method _merge_categories (line 523) | def _merge_categories(self, annotations): method _compute_vid_mappings (line 538) | def _compute_vid_mappings(self, annotations): method _compute_image_to_timestep_mappings (line 614) | def _compute_image_to_timestep_mappings(self): method _limit_dets_per_image (line 633) | def _limit_dets_per_image(self, annotations): method _fill_video_ids_inplace (line 653) | def _fill_video_ids_inplace(self, annotations): method _make_track_ids_unique (line 668) | def _make_track_ids_unique(annotations): method _split_known_unknown_distractor (line 698) | def _split_known_unknown_distractor(self): method _filter_gt_data (line 834) | def _filter_gt_data(self, raw_gt_data): FILE: sam3/eval/hota_eval_toolkit/trackeval/datasets/youtube_vis.py class YouTubeVIS (line 22) | class YouTubeVIS(_BaseDataset): method get_default_dataset_config (line 26) | def get_default_dataset_config(): method __init__ (line 52) | def __init__(self, config=None): method get_display_name (line 194) | def get_display_name(self, tracker): method _load_raw_file (line 197) | def _load_raw_file(self, tracker, seq, is_gt): method get_preprocessed_seq_data (line 311) | def get_preprocessed_seq_data(self, raw_data, cls): method _calculate_similarities (line 444) | def _calculate_similarities(self, gt_dets_t, tracker_dets_t): method _prepare_gt_annotations (line 457) | def _prepare_gt_annotations(self): method _get_tracker_seq_tracks (line 488) | def _get_tracker_seq_tracks(self, tracker, seq_id): method get_name (line 525) | def get_name(self): FILE: sam3/eval/hota_eval_toolkit/trackeval/eval.py class Evaluator (line 25) | class Evaluator: method get_default_eval_config (line 29) | def get_default_eval_config(): method __init__ (line 52) | def __init__(self, config=None): method _combine_results (line 61) | def _combine_results( method _summarize_results (line 155) | def _summarize_results( method evaluate (line 219) | def evaluate(self, dataset_list, metrics_list, show_progressbar=False): function eval_sequence (line 388) | def eval_sequence(seq, dataset, tracker, class_list, metrics_list, metri... FILE: sam3/eval/hota_eval_toolkit/trackeval/metrics/_base_metric.py class _BaseMetric (line 13) | class _BaseMetric(ABC): method __init__ (line 15) | def __init__(self): method eval_sequence (line 31) | def eval_sequence(self, data): ... method combine_sequences (line 34) | def combine_sequences(self, all_res): ... method combine_classes_class_averaged (line 37) | def combine_classes_class_averaged(self, all_res, ignore_empty_classes... method combine_classes_det_averaged (line 40) | def combine_classes_det_averaged(self, all_res): ... method plot_single_tracker_results (line 42) | def plot_single_tracker_results(self, all_res, tracker, output_folder,... method get_name (line 55) | def get_name(cls): method _combine_sum (line 59) | def _combine_sum(all_res, field): method _combine_weighted_av (line 64) | def _combine_weighted_av(all_res, field, comb_res, weight_field): method print_table (line 70) | def print_table( method _summary_row (line 87) | def _summary_row(self, results_): method _row_print (line 103) | def _row_print(*argv): method summary_results (line 112) | def summary_results(self, table_res): method detailed_results (line 118) | def detailed_results(self, table_res): method _detailed_row (line 139) | def _detailed_row(self, res): FILE: sam3/eval/hota_eval_toolkit/trackeval/metrics/count.py class Count (line 9) | class Count(_BaseMetric): method __init__ (line 12) | def __init__(self, config=None): method eval_sequence (line 19) | def eval_sequence(self, data): method combine_sequences (line 31) | def combine_sequences(self, all_res): method combine_classes_class_averaged (line 38) | def combine_classes_class_averaged(self, all_res, ignore_empty_classes... method combine_classes_det_averaged (line 45) | def combine_classes_det_averaged(self, all_res): FILE: sam3/eval/hota_eval_toolkit/trackeval/metrics/hota.py class HOTA (line 14) | class HOTA(_BaseMetric): method __init__ (line 19) | def __init__(self, config=None): method eval_sequence (line 42) | def eval_sequence(self, data): method combine_sequences (line 177) | def combine_sequences(self, all_res): method combine_classes_class_averaged (line 195) | def combine_classes_class_averaged(self, all_res, ignore_empty_classes... method combine_classes_det_averaged (line 235) | def combine_classes_det_averaged(self, all_res): method _compute_final_fields (line 254) | def _compute_final_fields(res): method plot_single_tracker_results (line 271) | def plot_single_tracker_results(self, table_res, tracker, cls, output_... FILE: sam3/eval/hota_eval_toolkit/trackeval/utils.py function init_config (line 11) | def init_config(config, default_config, name=None): function update_config (line 26) | def update_config(config): function get_code_path (line 60) | def get_code_path(): function validate_metrics_list (line 65) | def validate_metrics_list(metrics_list): function write_summary_results (line 86) | def write_summary_results(summaries, cls, output_folder): function write_detailed_results (line 156) | def write_detailed_results(details, cls, output_folder): function load_detail (line 174) | def load_detail(file): class TrackEvalException (line 194) | class TrackEvalException(Exception): FILE: sam3/eval/postprocessors.py class PostProcessNullOp (line 20) | class PostProcessNullOp(nn.Module): method __init__ (line 21) | def __init__(self, **kwargs): method forward (line 25) | def forward(self, input): method process_results (line 28) | def process_results(self, **kwargs): class PostProcessImage (line 32) | class PostProcessImage(nn.Module): method __init__ (line 35) | def __init__( method forward (line 62) | def forward( method _process_masks (line 153) | def _process_masks(self, target_sizes, pred_masks, consistent=True, ke... method _process_boxes_and_labels (line 221) | def _process_boxes_and_labels( method process_results (line 257) | def process_results( class PostProcessAPIVideo (line 327) | class PostProcessAPIVideo(PostProcessImage): method __init__ (line 330) | def __init__( method process_results (line 364) | def process_results( class PostProcessTracking (line 549) | class PostProcessTracking(PostProcessImage): method __init__ (line 552) | def __init__( method process_results (line 562) | def process_results( class PostProcessCounting (line 591) | class PostProcessCounting(nn.Module): method __init__ (line 594) | def __init__( method forward (line 610) | def forward(self, outputs, target_sizes): method process_results (line 635) | def process_results( FILE: sam3/eval/saco_veval_eval.py class VEvalEvaluator (line 19) | class VEvalEvaluator: method __init__ (line 20) | def __init__(self, gt_annot_file: str, eval_res_file: str): method run_eval (line 36) | def run_eval(self, pred_file: str): function run_main_all (line 63) | def run_main_all(dataset_name, args): function main_all (line 76) | def main_all(args): function main_one (line 93) | def main_one(args): function main (line 107) | def main(): FILE: sam3/eval/saco_veval_evaluators.py function _get_metric_index (line 25) | def _get_metric_index(metric_name: str, iou_threshold: Optional[float] =... class BasePredFileEvaluator (line 47) | class BasePredFileEvaluator: class YTVISPredFileEvaluator (line 53) | class YTVISPredFileEvaluator(BasePredFileEvaluator): method __init__ (line 56) | def __init__( method evaluate (line 67) | def evaluate(self, pred_file: str) -> Dict[str, float]: class VideoPhraseApEvaluator (line 118) | class VideoPhraseApEvaluator(BasePredFileEvaluator): method __init__ (line 121) | def __init__( method evaluate (line 132) | def evaluate(self, pred_file: str) -> Dict[str, float]: class VideoCGF1Evaluator (line 186) | class VideoCGF1Evaluator(BasePredFileEvaluator): method __init__ (line 189) | def __init__( method evaluate (line 202) | def evaluate(self, pred_file: str) -> Dict[str, float]: method extract_video_np_level_results (line 289) | def extract_video_np_level_results(self, demoF1Eval, video_np_level_re... class VideoTetaEvaluator (line 330) | class VideoTetaEvaluator(BasePredFileEvaluator): method __init__ (line 333) | def __init__( method process_predictions (line 371) | def process_predictions(self, pred_file: str, tmp_dir: str) -> str: method evaluate (line 406) | def evaluate(self, pred_file: str) -> Tuple[Dict[str, float], Dict]: class VideoPhraseHotaEvaluator (line 495) | class VideoPhraseHotaEvaluator(BasePredFileEvaluator): method __init__ (line 498) | def __init__( method evaluate (line 528) | def evaluate(self, pred_file: str) -> Dict[str, float]: method _remap_gt_dt (line 633) | def _remap_gt_dt(self, gt, dt): method extract_video_np_level_results (line 661) | def extract_video_np_level_results( class VideoClassBasedHotaEvaluator (line 682) | class VideoClassBasedHotaEvaluator(VideoPhraseHotaEvaluator): method __init__ (line 683) | def __init__( method _remap_gt_dt (line 692) | def _remap_gt_dt(self, gt, dt): method extract_video_np_level_results (line 695) | def extract_video_np_level_results(self, *args, **kwargs): function _compress_rle (line 699) | def _compress_rle(rle): function remap_video_category_pairs_to_unique_video_ids (line 709) | def remap_video_category_pairs_to_unique_video_ids( function remap_gt_dt_class_agnostic (line 772) | def remap_gt_dt_class_agnostic(gt, dt): function _fill_in_ann_height_width (line 829) | def _fill_in_ann_height_width(gt_json): FILE: sam3/eval/teta_eval_toolkit/_timing.py function time (line 16) | def time(f): FILE: sam3/eval/teta_eval_toolkit/config.py function parse_configs (line 11) | def parse_configs(): function get_default_eval_config (line 58) | def get_default_eval_config(): function get_default_dataset_config (line 80) | def get_default_dataset_config(): function init_config (line 104) | def init_config(config, default_config, name=None): function update_config (line 119) | def update_config(config): function get_code_path (line 153) | def get_code_path(): FILE: sam3/eval/teta_eval_toolkit/datasets/_base_dataset.py class _BaseDataset (line 20) | class _BaseDataset(ABC): method __init__ (line 22) | def __init__(self): method _load_raw_file (line 34) | def _load_raw_file(self, tracker, seq, is_gt): method get_preprocessed_seq_data (line 39) | def get_preprocessed_seq_data(self, raw_data, cls): method _calculate_similarities (line 43) | def _calculate_similarities(self, gt_dets_t, tracker_dets_t): method get_class_name (line 49) | def get_class_name(cls): method get_name (line 52) | def get_name(self): method get_output_fol (line 55) | def get_output_fol(self, tracker): method get_display_name (line 58) | def get_display_name(self, tracker): method get_eval_info (line 64) | def get_eval_info(self): method get_raw_seq_data (line 69) | def get_raw_seq_data(self, tracker, seq): method _load_simple_text_file (line 109) | def _load_simple_text_file( method _calculate_mask_ious (line 246) | def _calculate_mask_ious(masks1, masks2, is_encoded=False, do_ioa=False): method _calculate_box_ious (line 283) | def _calculate_box_ious(bboxes1, bboxes2, box_format="xywh", do_ioa=Fa... method _calculate_euclidean_similarity (line 332) | def _calculate_euclidean_similarity(dets1, dets2, zero_distance=2.0): method _check_unique_ids (line 343) | def _check_unique_ids(data, after_preproc=False): FILE: sam3/eval/teta_eval_toolkit/datasets/coco.py class COCO (line 22) | class COCO(_BaseDataset): method __init__ (line 25) | def __init__(self, config=None): method get_display_name (line 173) | def get_display_name(self, tracker): method _load_raw_file (line 176) | def _load_raw_file(self, tracker, seq, is_gt): method get_preprocessed_seq_data_thr (line 250) | def get_preprocessed_seq_data_thr(self, raw_data, cls, assignment=None): method get_preprocessed_seq_data (line 461) | def get_preprocessed_seq_data( method _calculate_similarities (line 481) | def _calculate_similarities(self, gt_dets_t, tk_dets_t): method _compute_vid_mappings (line 489) | def _compute_vid_mappings(self, annotations): method _compute_image_to_timestep_mappings (line 562) | def _compute_image_to_timestep_mappings(self): method _limit_dets_per_image (line 578) | def _limit_dets_per_image(self, annotations): method _fill_video_ids_inplace (line 596) | def _fill_video_ids_inplace(self, annotations): method _make_tk_ids_unique (line 610) | def _make_tk_ids_unique(annotations): FILE: sam3/eval/teta_eval_toolkit/datasets/tao.py class TAO (line 21) | class TAO(_BaseDataset): method __init__ (line 24) | def __init__(self, config=None): method get_display_name (line 179) | def get_display_name(self, tracker): method _load_raw_file (line 182) | def _load_raw_file(self, tracker, seq, is_gt): method get_preprocessed_seq_data_thr (line 258) | def get_preprocessed_seq_data_thr(self, raw_data, cls, assignment=None): method get_preprocessed_seq_data (line 472) | def get_preprocessed_seq_data( method _calculate_similarities (line 492) | def _calculate_similarities(self, gt_dets_t, tk_dets_t): method _merge_categories (line 500) | def _merge_categories(self, annotations): method _compute_vid_mappings (line 514) | def _compute_vid_mappings(self, annotations): method _compute_image_to_timestep_mappings (line 586) | def _compute_image_to_timestep_mappings(self): method _limit_dets_per_image (line 602) | def _limit_dets_per_image(self, annotations): method _fill_video_ids_inplace (line 620) | def _fill_video_ids_inplace(self, annotations): method _make_tk_ids_unique (line 634) | def _make_tk_ids_unique(annotations): FILE: sam3/eval/teta_eval_toolkit/eval.py class Evaluator (line 21) | class Evaluator: method __init__ (line 24) | def __init__(self, config=None): method evaluate (line 34) | def evaluate(self, dataset_list, metrics_list): method evaluate_tracker (line 91) | def evaluate_tracker( function eval_sequence (line 239) | def eval_sequence(seq, dataset, tracker, class_list, metrics_list, metri... FILE: sam3/eval/teta_eval_toolkit/metrics/_base_metric.py class _BaseMetric (line 14) | class _BaseMetric(ABC): method __init__ (line 16) | def __init__(self): method eval_sequence (line 32) | def eval_sequence(self, data): method combine_sequences (line 36) | def combine_sequences(self, all_res): method combine_classes_class_averaged (line 40) | def combine_classes_class_averaged(self, all_res, ignore_empty=False): method combine_classes_det_averaged (line 44) | def combine_classes_det_averaged(self, all_res): method plot_single_tracker_results (line 47) | def plot_single_tracker_results(self, all_res, tracker, output_folder,... method get_name (line 60) | def get_name(cls): method _combine_sum (line 64) | def _combine_sum(all_res, field): method _combine_weighted_av (line 69) | def _combine_weighted_av(all_res, field, comb_res, weight_field): method print_table (line 75) | def print_table(self, table_res, tracker, cls): method _summary_row (line 90) | def _summary_row(self, results_): method _row_print (line 106) | def _row_print(*argv): method summary_results (line 115) | def summary_results(self, table_res): method detailed_results (line 121) | def detailed_results(self, table_res): method _detailed_row (line 142) | def _detailed_row(self, res): FILE: sam3/eval/teta_eval_toolkit/metrics/teta.py class TETA (line 17) | class TETA(_BaseMetric): method __init__ (line 20) | def __init__(self, exhaustive=False, config=None): method compute_global_assignment (line 45) | def compute_global_assignment(self, data_thr, alpha=0.5): method eval_sequence_single_thr (line 77) | def eval_sequence_single_thr(self, data, cls, cid2clsname, cls_fp_thr,... method compute_global_alignment_score (line 184) | def compute_global_alignment_score(self, data): method compute_matches (line 209) | def compute_matches(self, data, t, ga_score, gt_ids, tk_ids, alpha): method compute_association_scores (line 225) | def compute_association_scores(self, res, matches_counts, gt_id_count,... method eval_sequence (line 249) | def eval_sequence(self, data, cls, cls_id_name_mapping, cls_fp): method combine_sequences (line 262) | def combine_sequences(self, all_res): method _combine_sequences_thr (line 280) | def _combine_sequences_thr(self, all_res): method combine_classes_class_averaged (line 292) | def combine_classes_class_averaged(self, all_res, ignore_empty=False): method _combine_classes_class_averaged_thr (line 314) | def _combine_classes_class_averaged_thr(self, all_res, ignore_empty=Fa... method combine_classes_det_averaged (line 337) | def combine_classes_det_averaged(self, all_res): method _combine_classes_det_averaged_thr (line 353) | def _combine_classes_det_averaged_thr(self, all_res): method _compute_final_fields (line 366) | def _compute_final_fields(res): method print_summary_table (line 394) | def print_summary_table(self, thr_res, thr, tracker, cls): FILE: sam3/eval/teta_eval_toolkit/utils.py function validate_metrics_list (line 11) | def validate_metrics_list(metrics_list): function get_track_id_str (line 32) | def get_track_id_str(ann): class TrackEvalException (line 45) | class TrackEvalException(Exception): FILE: sam3/eval/ytvis_coco_wrapper.py class YTVIS (line 16) | class YTVIS(COCO): method __init__ (line 22) | def __init__(self, annotation_file: str = None, ignore_gt_cats: bool =... method createIndex (line 32) | def createIndex(self): method getAnnIds (line 71) | def getAnnIds(self, imgIds=[], catIds=[], areaRng=[], iscrowd=None): method showAnns (line 80) | def showAnns(self, anns, draw_bbox=False): method loadRes (line 84) | def loadRes(self, resFile): method download (line 135) | def download(self, tarDir=None, imgIds=[]): method loadNumpyAnnotations (line 139) | def loadNumpyAnnotations(self, data): method annToRLE (line 143) | def annToRLE(self, ann): method annToMask (line 147) | def annToMask(self, ann): FILE: sam3/eval/ytvis_eval.py class YTVISevalMixin (line 32) | class YTVISevalMixin: method _prepare (line 38) | def _prepare(self): method computeIoU (line 69) | def computeIoU(self, imgId, catId): class YTVISeval (line 150) | class YTVISeval(YTVISevalMixin, COCOeval): class VideoDemoF1Eval (line 155) | class VideoDemoF1Eval(YTVISevalMixin, CGF1Eval): class YTVISResultsWriter (line 160) | class YTVISResultsWriter: method __init__ (line 166) | def __init__( method _dump_vid_preds (line 197) | def _dump_vid_preds(self, results): method prepare (line 201) | def prepare(self, predictions): method set_sync_device (line 272) | def set_sync_device(self, device: torch.device): method update (line 275) | def update(self, *args, **kwargs): method _dump_preds (line 280) | def _dump_preds(self): method synchronize_between_processes (line 293) | def synchronize_between_processes(self): method _dedup_pre_gather (line 303) | def _dedup_pre_gather(self, predictions): method _dedup_post_gather (line 346) | def _dedup_post_gather(self, list_of_prediction_dict): method compute_synced (line 366) | def compute_synced( method compute (line 407) | def compute(self): method reset (line 410) | def reset(self, *args, **kwargs): FILE: sam3/logger.py class ColoredFormatter (line 16) | class ColoredFormatter(logging.Formatter): method __init__ (line 19) | def __init__(self): method format (line 36) | def format(self, record): function get_logger (line 41) | def get_logger(name, level=logging.INFO): FILE: sam3/model/act_ckpt_utils.py function activation_ckpt_wrapper (line 19) | def activation_ckpt_wrapper(module: Union[nn.Module, Callable]) -> Calla... function clone_output_wrapper (line 95) | def clone_output_wrapper(f: Callable[..., T]) -> Callable[..., T]: FILE: sam3/model/box_ops.py function box_cxcywh_to_xyxy (line 13) | def box_cxcywh_to_xyxy(x): function box_cxcywh_to_xywh (line 19) | def box_cxcywh_to_xywh(x): function box_xywh_to_xyxy (line 25) | def box_xywh_to_xyxy(x): function box_xywh_to_cxcywh (line 31) | def box_xywh_to_cxcywh(x): function box_xyxy_to_xywh (line 37) | def box_xyxy_to_xywh(x): function box_xyxy_to_cxcywh (line 43) | def box_xyxy_to_cxcywh(x): function box_area (line 49) | def box_area(boxes): function masks_to_boxes (line 63) | def masks_to_boxes(masks): function box_iou (line 93) | def box_iou(boxes1, boxes2): function generalized_box_iou (line 121) | def generalized_box_iou(boxes1, boxes2): function fast_diag_generalized_box_iou (line 148) | def fast_diag_generalized_box_iou(boxes1, boxes2): function fast_diag_box_iou (line 175) | def fast_diag_box_iou(boxes1, boxes2): function box_xywh_inter_union (line 198) | def box_xywh_inter_union( FILE: sam3/model/data_misc.py function interpolate (line 19) | def interpolate( class BatchedPointer (line 48) | class BatchedPointer: class FindStage (line 62) | class FindStage: class BatchedFindTarget (line 86) | class BatchedFindTarget: class BatchedInferenceMetadata (line 126) | class BatchedInferenceMetadata: class BatchedDatapoint (line 161) | class BatchedDatapoint: function convert_my_tensors (line 170) | def convert_my_tensors(obj): FILE: sam3/model/decoder.py class TransformerDecoderLayer (line 28) | class TransformerDecoderLayer(nn.Module): method __init__ (line 29) | def __init__( method with_pos_embed (line 67) | def with_pos_embed(tensor, pos): method forward_ffn (line 70) | def forward_ffn(self, tgt): method forward (line 77) | def forward( class TransformerDecoder (line 187) | class TransformerDecoder(nn.Module): method __init__ (line 188) | def __init__( method _get_coords (line 323) | def _get_coords(H, W, device): method _get_rpb_matrix (line 328) | def _get_rpb_matrix(self, reference_boxes, feat_size): method forward (line 407) | def forward( class TransformerEncoderCrossAttention (line 611) | class TransformerEncoderCrossAttention(nn.Module): method __init__ (line 612) | def __init__( method forward (line 652) | def forward( class TransformerDecoderLayerv1 (line 723) | class TransformerDecoderLayerv1(nn.Module): method __init__ (line 724) | def __init__( method forward_post (line 764) | def forward_post( method forward_pre (line 806) | def forward_pre( method forward (line 853) | def forward( class TransformerDecoderLayerv2 (line 883) | class TransformerDecoderLayerv2(TransformerDecoderLayerv1): method __init__ (line 884) | def __init__(self, cross_attention_first=False, *args: Any, **kwds: Any): method _forward_sa (line 888) | def _forward_sa(self, tgt, query_pos): method _forward_ca (line 896) | def _forward_ca(self, tgt, memory, query_pos, pos, num_k_exclude_rope=0): method forward_pre (line 916) | def forward_pre( method forward (line 950) | def forward(self, *args: Any, **kwds: Any) -> torch.Tensor: FILE: sam3/model/edt.py function edt_kernel (line 56) | def edt_kernel(inputs_ptr, outputs_ptr, v, z, height, width, horizontal:... function edt_triton (line 119) | def edt_triton(data: torch.Tensor): FILE: sam3/model/encoder.py class TransformerEncoderLayer (line 15) | class TransformerEncoderLayer(nn.Module): method __init__ (line 27) | def __init__( method forward_post (line 84) | def forward_post( method forward_pre (line 141) | def forward_pre( method forward (line 205) | def forward( class TransformerEncoder (line 254) | class TransformerEncoder(nn.Module): method __init__ (line 272) | def __init__( method get_reference_points (line 303) | def get_reference_points(spatial_shapes, valid_ratios, device): method _prepare_multilevel_features (line 324) | def _prepare_multilevel_features(self, srcs, masks, pos_embeds): method forward (line 380) | def forward( class TransformerEncoderFusion (line 464) | class TransformerEncoderFusion(TransformerEncoder): method __init__ (line 483) | def __init__( method get_reference_points (line 511) | def get_reference_points(spatial_shapes, valid_ratios, device): method forward (line 515) | def forward( function pool_text_feat (line 582) | def pool_text_feat(prompt, prompt_mask, pool_with_mask): FILE: sam3/model/geometry_encoders.py function is_right_padded (line 17) | def is_right_padded(mask): function concat_padded_sequences (line 23) | def concat_padded_sequences(seq1, mask1, seq2, mask2, return_index: bool... class Prompt (line 83) | class Prompt: method __init__ (line 102) | def __init__( method _init_seq_len_and_device (line 240) | def _init_seq_len_and_device( method _init_box (line 283) | def _init_box(self, box_embeddings, box_labels, box_mask, box_seq_len,... method _init_point (line 292) | def _init_point( method _init_mask (line 308) | def _init_mask( method append_boxes (line 320) | def append_boxes(self, boxes, labels, mask=None): method append_points (line 343) | def append_points(self, points, labels, mask=None): method append_masks (line 366) | def append_masks(self, masks, labels=None, attn_mask=None): method clone (line 387) | def clone(self): class MaskEncoder (line 404) | class MaskEncoder(nn.Module): method __init__ (line 409) | def __init__( method forward (line 418) | def forward(self, masks, *args, **kwargs) -> Tuple[torch.Tensor, torch... class FusedMaskEncoder (line 425) | class FusedMaskEncoder(MaskEncoder): method __init__ (line 432) | def __init__( method forward (line 448) | def forward( class SequenceGeometryEncoder (line 470) | class SequenceGeometryEncoder(nn.Module): method __init__ (line 491) | def __init__( method _encode_points (line 589) | def _encode_points(self, points, points_mask, points_labels, img_feats): method _encode_boxes (line 632) | def _encode_boxes(self, boxes, boxes_mask, boxes_labels, img_feats): method _encode_masks (line 683) | def _encode_masks( method forward (line 717) | def forward(self, geo_prompt: Prompt, img_feats, img_sizes, img_pos_em... FILE: sam3/model/io_utils.py function load_resource_as_video_frames (line 29) | def load_resource_as_video_frames( function load_image_as_single_frame_video (line 93) | def load_image_as_single_frame_video( function load_video_frames (line 116) | def load_video_frames( function load_video_frames_from_image_folder (line 158) | def load_video_frames_from_image_folder( function load_video_frames_from_video_file (line 213) | def load_video_frames_from_video_file( function load_video_frames_from_video_file_using_cv2 (line 255) | def load_video_frames_from_video_file_using_cv2( function load_dummy_video (line 325) | def load_dummy_video(image_size, offload_video_to_cpu, num_frames=60): function _load_img_as_tensor (line 336) | def _load_img_as_tensor(img_path, image_size): class AsyncImageFrameLoader (line 345) | class AsyncImageFrameLoader: method __init__ (line 350) | def __init__(self, img_paths, image_size, offload_video_to_cpu, img_me... method __getitem__ (line 382) | def __getitem__(self, index): method __len__ (line 405) | def __len__(self): class TorchCodecDecoder (line 409) | class TorchCodecDecoder: method __init__ (line 415) | def __init__(self, source, dimension_order="NCHW", device="cpu", num_t... method __len__ (line 442) | def __len__(self) -> int: method __getitem__ (line 445) | def __getitem__(self, key: int): class FIFOLock (line 461) | class FIFOLock: method __init__ (line 464) | def __init__(self): method acquire (line 469) | def acquire(self): method release (line 479) | def release(self): method __enter__ (line 485) | def __enter__(self): method __exit__ (line 488) | def __exit__(self, t, v, tb): class AsyncVideoFileLoaderWithTorchCodec (line 492) | class AsyncVideoFileLoaderWithTorchCodec: method __init__ (line 500) | def __init__( method _load_one_frame (line 573) | def _load_one_frame(self, idx): method _start_video_loading (line 578) | def _start_video_loading(self): method _transform_frame (line 652) | def _transform_frame(self, frame): method __getitem__ (line 672) | def __getitem__(self, index): method __len__ (line 694) | def __len__(self): method __getstate__ (line 697) | def __getstate__(self): FILE: sam3/model/maskformer_segmentation.py class LinearPresenceHead (line 16) | class LinearPresenceHead(nn.Sequential): method __init__ (line 17) | def __init__(self, d_model): method forward (line 21) | def forward(self, hs, prompt, prompt_mask): class MaskPredictor (line 25) | class MaskPredictor(nn.Module): method __init__ (line 26) | def __init__(self, hidden_dim, mask_dim): method forward (line 30) | def forward(self, obj_queries, pixel_embed): class SegmentationHead (line 56) | class SegmentationHead(nn.Module): method __init__ (line 57) | def __init__( method device (line 95) | def device(self): method to (line 99) | def to(self, *args, **kwargs): method _embed_pixels (line 104) | def _embed_pixels( method forward (line 147) | def forward( class PixelDecoder (line 174) | class PixelDecoder(nn.Module): method __init__ (line 175) | def __init__( method forward (line 205) | def forward(self, backbone_feats: List[torch.Tensor]): class UniversalSegmentationHead (line 224) | class UniversalSegmentationHead(SegmentationHead): method __init__ (line 227) | def __init__( method forward (line 272) | def forward( FILE: sam3/model/memory.py class SimpleMaskDownSampler (line 21) | class SimpleMaskDownSampler(nn.Module): method __init__ (line 30) | def __init__( method forward (line 71) | def forward(self, x: torch.Tensor): class CXBlock (line 84) | class CXBlock(nn.Module): method __init__ (line 96) | def __init__( method forward (line 126) | def forward(self, x): class SimpleFuser (line 142) | class SimpleFuser(nn.Module): method __init__ (line 143) | def __init__(self, layer, num_layers, dim=None, input_projection=False): method forward (line 152) | def forward(self, x): class SimpleMaskEncoder (line 160) | class SimpleMaskEncoder(nn.Module): method __init__ (line 161) | def __init__( method forward (line 180) | def forward( FILE: sam3/model/model_misc.py function inverse_sigmoid (line 22) | def inverse_sigmoid(x, eps=1e-3): class MultiheadAttentionWrapper (line 33) | class MultiheadAttentionWrapper(nn.MultiheadAttention): method forward (line 34) | def forward(self, *args, **kwargs): class DotProductScoring (line 39) | class DotProductScoring(torch.nn.Module): method __init__ (line 40) | def __init__( method mean_pool_text (line 59) | def mean_pool_text(self, prompt, prompt_mask): method forward (line 68) | def forward(self, hs, prompt, prompt_mask): class LayerScale (line 96) | class LayerScale(nn.Module): method __init__ (line 97) | def __init__( method forward (line 107) | def forward(self, x: Tensor) -> Tensor: class LayerNorm2d (line 111) | class LayerNorm2d(nn.Module): method __init__ (line 112) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 118) | def forward(self, x: torch.Tensor) -> torch.Tensor: class TransformerWrapper (line 126) | class TransformerWrapper(nn.Module): method __init__ (line 127) | def __init__( method _reset_parameters (line 151) | def _reset_parameters(self): class MLP (line 162) | class MLP(nn.Module): method __init__ (line 165) | def __init__( method forward (line 190) | def forward(self, x): function get_clones (line 200) | def get_clones(module, N): function get_clones_seq (line 204) | def get_clones_seq(module, N): function get_activation_fn (line 208) | def get_activation_fn(activation): function get_activation_module (line 219) | def get_activation_module(activation): function get_valid_ratio (line 230) | def get_valid_ratio(mask): function gen_sineembed_for_position (line 240) | def gen_sineembed_for_position(pos_tensor, num_feats=256): class SAM3Output (line 279) | class SAM3Output(list): class IterMode (line 312) | class IterMode(Enum): method __init__ (line 318) | def __init__( method __iter__ (line 353) | def __iter__(self) -> Iterator: method __getitem__ (line 356) | def __getitem__(self, index): class _IterationMode (line 376) | class _IterationMode(AbstractContextManager): method __init__ (line 382) | def __init__( method __enter__ (line 390) | def __enter__(self) -> "SAM3Output": method __exit__ (line 395) | def __exit__(self, exc_type, exc_value, traceback): method iteration_mode (line 400) | def iteration_mode( method append (line 413) | def append(self, item: list): method __repr__ (line 419) | def __repr__(self): method __len__ (line 422) | def __len__(self): FILE: sam3/model/necks.py class Sam3DualViTDetNeck (line 14) | class Sam3DualViTDetNeck(nn.Module): method __init__ (line 15) | def __init__( method forward (line 101) | def forward( FILE: sam3/model/position_encoding.py class PositionEmbeddingSine (line 12) | class PositionEmbeddingSine(nn.Module): method __init__ (line 18) | def __init__( method _encode_xy (line 54) | def _encode_xy(self, x, y): method encode_boxes (line 74) | def encode_boxes(self, x, y, w, h): method encode_points (line 82) | def encode_points(self, x, y, labels): method forward (line 91) | def forward(self, x): FILE: sam3/model/sam1_task_predictor.py class SAM3InteractiveImagePredictor (line 21) | class SAM3InteractiveImagePredictor(nn.Module): method __init__ (line 22) | def __init__( method set_image (line 70) | def set_image( method set_image_batch (line 120) | def set_image_batch( method predict_batch (line 167) | def predict_batch( method predict (line 229) | def predict( method _prep_prompts (line 297) | def _prep_prompts( method _predict (line 328) | def _predict( method get_image_embedding (line 431) | def get_image_embedding(self) -> torch.Tensor: method device (line 447) | def device(self) -> torch.device: method reset_predictor (line 450) | def reset_predictor(self) -> None: FILE: sam3/model/sam3_image.py function _update_out (line 23) | def _update_out(out, out_name, out_value, auxiliary=True, update_aux=True): class Sam3Image (line 33) | class Sam3Image(torch.nn.Module): method __init__ (line 38) | def __init__( method device (line 105) | def device(self): method to (line 109) | def to(self, *args, **kwargs): method _get_img_feats (line 114) | def _get_img_feats(self, backbone_out, img_ids): method _encode_prompt (line 166) | def _encode_prompt( method _run_encoder (line 211) | def _run_encoder( method _run_decoder (line 251) | def _run_decoder( method _update_scores_and_boxes (line 299) | def _update_scores_and_boxes( method _run_segmentation_heads (line 385) | def _run_segmentation_heads( method _get_best_mask (line 425) | def _get_best_mask(self, out): method forward_grounding (line 439) | def forward_grounding( method _postprocess_out (line 492) | def _postprocess_out(self, out: Dict, multimask_output: bool = False): method _get_dummy_prompt (line 519) | def _get_dummy_prompt(self, num_prompts=1): method forward (line 527) | def forward(self, input: BatchedDatapoint): method _compute_matching (line 575) | def _compute_matching(self, out, targets): method back_convert (line 580) | def back_convert(self, targets): method predict_inst (line 596) | def predict_inst( method predict_inst_batch (line 635) | def predict_inst_batch( class Sam3ImageOnVideoMultiGPU (line 684) | class Sam3ImageOnVideoMultiGPU(Sam3Image): method __init__ (line 685) | def __init__( method forward_video_grounding_multigpu (line 698) | def forward_video_grounding_multigpu( method _build_multigpu_buffer_next_chunk (line 789) | def _build_multigpu_buffer_next_chunk( method _gather_tensor (line 870) | def _gather_tensor(self, x): FILE: sam3/model/sam3_image_processor.py class Sam3Processor (line 14) | class Sam3Processor: method __init__ (line 17) | def __init__(self, model, resolution=1008, device="cuda", confidence_t... method set_image (line 42) | def set_image(self, image, state=None): method set_image_batch (line 76) | def set_image_batch(self, images: List[np.ndarray], state=None): method set_text_prompt (line 113) | def set_text_prompt(self, prompt: str, state: Dict): method add_geometric_prompt (line 128) | def add_geometric_prompt(self, box: List, label: bool, state: Dict): method reset_all_prompts (line 154) | def reset_all_prompts(self, state: Dict): method set_confidence_threshold (line 172) | def set_confidence_threshold(self, threshold: float, state=None): method _forward_grounding (line 183) | def _forward_grounding(self, state: Dict): FILE: sam3/model/sam3_tracker_base.py class Sam3TrackerBase (line 26) | class Sam3TrackerBase(torch.nn.Module): method __init__ (line 27) | def __init__( method device (line 158) | def device(self): method _get_tpos_enc (line 161) | def _get_tpos_enc(self, rel_pos_list, device, max_abs_pos=None, dummy=... method _build_sam_heads (line 176) | def _build_sam_heads(self): method _forward_sam_heads (line 217) | def _forward_sam_heads( method _use_mask_as_output (line 388) | def _use_mask_as_output(self, backbone_features, high_res_features, ma... method forward (line 436) | def forward(self, input: BatchedDatapoint, is_inference=False): method forward_image (line 442) | def forward_image(self, img_batch): method _prepare_backbone_features (line 465) | def _prepare_backbone_features(self, backbone_out): method _prepare_backbone_features_per_frame (line 481) | def _prepare_backbone_features_per_frame(self, img_batch, img_ids): method cal_mem_score (line 508) | def cal_mem_score(self, object_score_logits, iou_score): method frame_filter (line 517) | def frame_filter(self, output_dict, track_in_reverse, frame_idx, num_f... method _prepare_memory_conditioned_features (line 559) | def _prepare_memory_conditioned_features( method _encode_new_memory (line 796) | def _encode_new_memory( method forward_tracking (line 851) | def forward_tracking(self, backbone_out, input, return_dict=False): method track_step (line 929) | def track_step( method _use_multimask (line 1105) | def _use_multimask(self, is_init_cond_frame, point_inputs): method _apply_non_overlapping_constraints (line 1115) | def _apply_non_overlapping_constraints(self, pred_masks): method _compile_all_components (line 1135) | def _compile_all_components(self): method _maybe_clone (line 1172) | def _maybe_clone(self, x): function concat_points (line 1177) | def concat_points(old_point_inputs, new_points, new_labels): FILE: sam3/model/sam3_tracker_utils.py function sample_box_points (line 12) | def sample_box_points( function mask_to_box (line 58) | def mask_to_box(masks: torch.Tensor): function sample_random_points_from_errors (line 87) | def sample_random_points_from_errors(gt_masks, pred_masks, num_pt=1): function sample_one_point_from_error_center (line 137) | def sample_one_point_from_error_center(gt_masks, pred_masks, padding=True): function sample_one_point_from_error_center_slow (line 197) | def sample_one_point_from_error_center_slow(gt_masks, pred_masks, paddin... function get_next_point (line 262) | def get_next_point(gt_masks, pred_masks, method): function select_closest_cond_frames (line 271) | def select_closest_cond_frames( function get_1d_sine_pe (line 328) | def get_1d_sine_pe(pos_inds, dim, temperature=10000): function get_best_gt_match_from_multimasks (line 341) | def get_best_gt_match_from_multimasks(pred_multimasks, gt_masks, pred_sc... function fill_holes_in_mask_scores (line 370) | def fill_holes_in_mask_scores(mask, max_area, fill_holes=True, remove_sp... function _get_connected_components_with_padding (line 409) | def _get_connected_components_with_padding(mask): FILE: sam3/model/sam3_tracking_predictor.py class Sam3TrackerPredictor (line 15) | class Sam3TrackerPredictor(Sam3TrackerBase): method __init__ (line 21) | def __init__( method init_state (line 57) | def init_state( method _obj_id_to_idx (line 138) | def _obj_id_to_idx(self, inference_state, obj_id): method _obj_idx_to_id (line 171) | def _obj_idx_to_id(self, inference_state, obj_idx): method _get_obj_num (line 175) | def _get_obj_num(self, inference_state): method add_new_points_or_box (line 180) | def add_new_points_or_box( method add_new_mask (line 343) | def add_new_mask( method add_new_points (line 461) | def add_new_points(self, *args, **kwargs): method _get_orig_video_res_output (line 465) | def _get_orig_video_res_output(self, inference_state, any_res_masks): method _consolidate_temp_output_across_obj (line 492) | def _consolidate_temp_output_across_obj( method _get_empty_mask_ptr (line 632) | def _get_empty_mask_ptr(self, inference_state, frame_idx): method propagate_in_video_preflight (line 673) | def propagate_in_video_preflight(self, inference_state, run_mem_encode... method _get_processing_order (line 759) | def _get_processing_order( method propagate_in_video (line 790) | def propagate_in_video( method _add_output_per_object (line 875) | def _add_output_per_object( method clear_all_points_in_frame (line 907) | def clear_all_points_in_frame( method clear_all_points_in_video (line 979) | def clear_all_points_in_video(self, inference_state): method _reset_tracking_results (line 991) | def _reset_tracking_results(self, inference_state): method _get_image_feature (line 1011) | def _get_image_feature(self, inference_state, frame_idx, batch_size): method _run_single_frame_inference (line 1050) | def _run_single_frame_inference( method _run_memory_encoder (line 1119) | def _run_memory_encoder( method _get_maskmem_pos_enc (line 1156) | def _get_maskmem_pos_enc(self, inference_state, current_out): method remove_object (line 1182) | def remove_object(self, inference_state, obj_id, strict=False, need_ou... method _clear_non_cond_mem_around_input (line 1300) | def _clear_non_cond_mem_around_input(self, inference_state, frame_idx): method _suppress_shrinked_masks (line 1319) | def _suppress_shrinked_masks( method _suppress_object_pw_area_shrinkage (line 1333) | def _suppress_object_pw_area_shrinkage(self, pred_masks): method _apply_object_wise_non_overlapping_constraints (line 1349) | def _apply_object_wise_non_overlapping_constraints( FILE: sam3/model/sam3_video_base.py class MaskletConfirmationStatus (line 31) | class MaskletConfirmationStatus(Enum): class Sam3VideoBase (line 36) | class Sam3VideoBase(nn.Module): method __init__ (line 37) | def __init__( method device (line 137) | def device(self): method _init_dist_pg_cpu (line 141) | def _init_dist_pg_cpu(self): method broadcast_python_obj_cpu (line 147) | def broadcast_python_obj_cpu(self, python_obj_list, src): method _det_track_one_frame (line 152) | def _det_track_one_frame( method _suppress_detections_close_to_boundary (line 294) | def _suppress_detections_close_to_boundary(self, boxes, margin=0.025): method run_backbone_and_detection (line 313) | def run_backbone_and_detection( method run_tracker_propagation (line 402) | def run_tracker_propagation( method _recondition_masklets (line 454) | def _recondition_masklets( method run_tracker_update_planning_phase (line 506) | def run_tracker_update_planning_phase( method _suppress_overlapping_based_on_recent_occlusion (line 820) | def _suppress_overlapping_based_on_recent_occlusion( method run_tracker_update_execution_phase (line 893) | def run_tracker_update_execution_phase( method build_outputs (line 936) | def build_outputs( method _get_objects_to_suppress_based_on_most_recently_occluded (line 1016) | def _get_objects_to_suppress_based_on_most_recently_occluded( method _propogate_tracker_one_frame_local_gpu (line 1098) | def _propogate_tracker_one_frame_local_gpu( method _associate_det_trk (line 1161) | def _associate_det_trk( method _assign_new_det_to_gpus (line 1299) | def _assign_new_det_to_gpus(self, new_det_num, prev_workload_per_gpu): method _process_hotstart (line 1312) | def _process_hotstart( method _tracker_update_memories (line 1438) | def _tracker_update_memories( method _tracker_add_new_objects (line 1517) | def _tracker_add_new_objects( method _tracker_remove_object (line 1575) | def _tracker_remove_object(self, tracker_states_local: List[Any], obj_... method _tracker_remove_objects (line 1592) | def _tracker_remove_objects( method _initialize_metadata (line 1602) | def _initialize_metadata(self): method update_masklet_confirmation_status (line 1644) | def update_masklet_confirmation_status( method forward (line 1697) | def forward(self, input: BatchedDatapoint, is_inference: bool = False): method _load_checkpoint (line 1700) | def _load_checkpoint(self, ckpt_path: str, strict: bool = True): method prep_for_evaluator (line 1708) | def prep_for_evaluator(self, video_frames, tracking_res, scores_labels): method _encode_prompt (line 1751) | def _encode_prompt(self, **kwargs): method _drop_new_det_with_obj_limit (line 1754) | def _drop_new_det_with_obj_limit(self, new_det_fa_inds, det_scores_np,... FILE: sam3/model/sam3_video_inference.py class Sam3VideoInference (line 30) | class Sam3VideoInference(Sam3VideoBase): method __init__ (line 34) | def __init__( method init_state (line 55) | def init_state( method reset_state (line 92) | def reset_state(self, inference_state): method _construct_initial_input_batch (line 114) | def _construct_initial_input_batch(self, inference_state, images): method _get_visual_prompt (line 179) | def _get_visual_prompt(self, inference_state, frame_idx, boxes_cxcywh,... method _get_processing_order (line 222) | def _get_processing_order( method propagate_in_video (line 251) | def propagate_in_video( method _run_single_frame_inference (line 358) | def _run_single_frame_inference(self, inference_state, frame_idx, reve... method _postprocess_output (line 430) | def _postprocess_output( method _cache_frame_outputs (line 524) | def _cache_frame_outputs( method _build_tracker_output (line 551) | def _build_tracker_output( method _compile_model (line 574) | def _compile_model(self): method _warm_up_vg_propagation (line 654) | def _warm_up_vg_propagation(self, inference_state, start_frame_idx=0): method add_fake_objects_to_inference_state (line 741) | def add_fake_objects_to_inference_state( method warm_up_compilation (line 802) | def warm_up_compilation(self): method add_prompt (line 840) | def add_prompt( method forward (line 910) | def forward(self, input: BatchedDatapoint, is_inference: bool = False): method back_convert (line 960) | def back_convert(self, targets): class Sam3VideoInferenceWithInstanceInteractivity (line 965) | class Sam3VideoInferenceWithInstanceInteractivity(Sam3VideoInference): method __init__ (line 966) | def __init__( method _init_new_tracker_state (line 987) | def _init_new_tracker_state(self, inference_state): method propagate_in_video (line 996) | def propagate_in_video( method add_action_history (line 1191) | def add_action_history( method _has_object_been_refined (line 1214) | def _has_object_been_refined(self, inference_state, obj_id): method parse_action_history_for_propagation (line 1222) | def parse_action_history_for_propagation(self, inference_state): method remove_object (line 1280) | def remove_object(self, inference_state, obj_id, is_user_action=False): method _get_gpu_id_by_obj_id (line 1317) | def _get_gpu_id_by_obj_id(self, inference_state, obj_id): method _get_tracker_inference_states_by_obj_ids (line 1327) | def _get_tracker_inference_states_by_obj_ids(self, inference_state, ob... method _prepare_backbone_feats (line 1340) | def _prepare_backbone_feats(self, inference_state, frame_idx, reverse): method add_prompt (line 1360) | def add_prompt( method add_tracker_new_points (line 1400) | def add_tracker_new_points( method _gather_obj_id_to_mask_across_gpus (line 1612) | def _gather_obj_id_to_mask_across_gpus(self, inference_state, obj_id_t... method _convert_low_res_mask_to_video_res (line 1647) | def _convert_low_res_mask_to_video_res(self, low_res_mask, inference_s... method clear_detector_added_cond_frame_in_tracker (line 1678) | def clear_detector_added_cond_frame_in_tracker( function is_image_type (line 1709) | def is_image_type(resource_path: str) -> bool: FILE: sam3/model/sam3_video_predictor.py class Sam3VideoPredictor (line 24) | class Sam3VideoPredictor: method __init__ (line 28) | def __init__( method handle_request (line 59) | def handle_request(self, request): method handle_stream_request (line 92) | def handle_stream_request(self, request): method start_session (line 105) | def start_session(self, resource_path, session_id=None): method add_prompt (line 134) | def add_prompt( method remove_object (line 166) | def remove_object( method propagate_in_video (line 186) | def propagate_in_video( method reset_session (line 231) | def reset_session(self, session_id): method close_session (line 239) | def close_session(self, session_id): method _get_session (line 256) | def _get_session(self, session_id): method _get_session_stats (line 264) | def _get_session_stats(self): method _get_torch_and_gpu_properties (line 280) | def _get_torch_and_gpu_properties(self): method shutdown (line 288) | def shutdown(self): class Sam3VideoPredictorMultiGPU (line 293) | class Sam3VideoPredictorMultiGPU(Sam3VideoPredictor): method __init__ (line 294) | def __init__(self, *model_args, gpus_to_use=None, **model_kwargs): method handle_request (line 336) | def handle_request(self, request): method handle_stream_request (line 359) | def handle_stream_request(self, request): method _start_worker_processes (line 376) | def _start_worker_processes(self, *model_args, **model_kwargs): method _start_nccl_process_group (line 415) | def _start_nccl_process_group(self): method _find_free_port (line 438) | def _find_free_port(self) -> int: method _worker_process_command_loop (line 449) | def _worker_process_command_loop( method shutdown (line 512) | def shutdown(self): FILE: sam3/model/text_encoder_ve.py class ResidualAttentionBlock (line 15) | class ResidualAttentionBlock(nn.Module): method __init__ (line 16) | def __init__( method attention (line 56) | def attention( method forward (line 72) | def forward( class Transformer (line 92) | class Transformer(nn.Module): method __init__ (line 93) | def __init__( method forward (line 130) | def forward( function text_global_pool (line 150) | def text_global_pool( class TextTransformer (line 166) | class TextTransformer(nn.Module): method __init__ (line 167) | def __init__( method build_causal_mask (line 222) | def build_causal_mask(self) -> torch.Tensor: method forward (line 230) | def forward( class VETextEncoder (line 255) | class VETextEncoder(nn.Module): method __init__ (line 256) | def __init__( method forward (line 288) | def forward( FILE: sam3/model/tokenizer_ve.py function bytes_to_unicode (line 32) | def bytes_to_unicode(): function get_pairs (line 58) | def get_pairs(word): function basic_clean (line 70) | def basic_clean(text): function whitespace_clean (line 76) | def whitespace_clean(text): function _clean_canonicalize (line 82) | def _clean_canonicalize(x): function _clean_lower (line 87) | def _clean_lower(x): function _clean_whitespace (line 92) | def _clean_whitespace(x): function get_clean_fn (line 97) | def get_clean_fn(type: str): function canonicalize_text (line 108) | def canonicalize_text(text, *, keep_punctuation_exact_string=None): class SimpleTokenizer (line 130) | class SimpleTokenizer(object): method __init__ (line 131) | def __init__( method bpe (line 170) | def bpe(self, token): method encode (line 208) | def encode(self, text): method decode (line 218) | def decode(self, tokens): method __call__ (line 227) | def __call__( FILE: sam3/model/utils/misc.py function _is_named_tuple (line 12) | def _is_named_tuple(x) -> bool: class _CopyableData (line 17) | class _CopyableData(Protocol): method to (line 18) | def to(self, device: torch.device, *args: Any, **kwargs: Any): function copy_data_to_device (line 23) | def copy_data_to_device(data, device: torch.device, *args: Any, **kwargs... FILE: sam3/model/utils/sam1_utils.py class SAM2Transforms (line 18) | class SAM2Transforms(nn.Module): method __init__ (line 19) | def __init__( method __call__ (line 40) | def __call__(self, x): method forward_batch (line 44) | def forward_batch(self, img_list): method transform_coords (line 49) | def transform_coords( method transform_boxes (line 69) | def transform_boxes( method postprocess_masks (line 79) | def postprocess_masks(self, masks: torch.Tensor, orig_hw) -> torch.Ten... FILE: sam3/model/utils/sam2_utils.py function _load_img_as_tensor (line 18) | def _load_img_as_tensor(img_path, image_size): class AsyncVideoFrameLoader (line 30) | class AsyncVideoFrameLoader: method __init__ (line 35) | def __init__( method __getitem__ (line 73) | def __getitem__(self, index): method __len__ (line 94) | def __len__(self): function load_video_frames (line 98) | def load_video_frames( function load_video_frames_from_jpg_images (line 139) | def load_video_frames_from_jpg_images( function load_video_frames_from_video_file (line 206) | def load_video_frames_from_video_file( FILE: sam3/model/vitdet.py function init_t_xy (line 34) | def init_t_xy( function compute_axial_cis (line 43) | def compute_axial_cis( function reshape_for_broadcast (line 62) | def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor) -> t... function apply_rotary_enc (line 70) | def apply_rotary_enc( function window_partition (line 95) | def window_partition(x: Tensor, window_size: int) -> Tuple[Tensor, Tuple... function window_unpartition (line 118) | def window_unpartition( function get_rel_pos (line 144) | def get_rel_pos(q_size: int, k_size: int, rel_pos: Tensor) -> Tensor: function get_abs_pos (line 177) | def get_abs_pos( function concat_rel_pos (line 241) | def concat_rel_pos( class PatchEmbed (line 301) | class PatchEmbed(nn.Module): method __init__ (line 306) | def __init__( method forward (line 334) | def forward(self, x: Tensor) -> Tensor: class Attention (line 341) | class Attention(nn.Module): method __init__ (line 344) | def __init__( method _setup_rel_pos (line 396) | def _setup_rel_pos(self, rel_pos_zero_init: bool = True) -> None: method _setup_rope_freqs (line 423) | def _setup_rope_freqs(self) -> None: method _apply_rope (line 461) | def _apply_rope(self, q, k) -> Tuple[Tensor, Tensor]: method forward (line 468) | def forward(self, x: Tensor) -> Tensor: class Block (line 520) | class Block(nn.Module): method __init__ (line 523) | def __init__( method forward (line 599) | def forward(self, x: Tensor) -> Tensor: class ViT (line 618) | class ViT(nn.Module): method __init__ (line 625) | def __init__( method _init_weights (line 806) | def _init_weights(self, m: nn.Module) -> None: method forward (line 815) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method get_layer_id (line 863) | def get_layer_id(self, layer_name: str) -> int: method get_num_layers (line 880) | def get_num_layers(self) -> int: FILE: sam3/model/vl_combiner.py class SAM3VLBackbone (line 18) | class SAM3VLBackbone(nn.Module): method __init__ (line 25) | def __init__( method forward (line 49) | def forward( method forward_image (line 79) | def forward_image(self, samples: torch.Tensor): method _forward_image_no_act_ckpt (line 85) | def _forward_image_no_act_ckpt(self, samples): method forward_text (line 122) | def forward_text( method _forward_text_no_ack_ckpt (line 133) | def _forward_text_no_ack_ckpt( FILE: sam3/model_builder.py function _setup_tf32 (line 49) | def _setup_tf32() -> None: function _create_position_encoding (line 61) | def _create_position_encoding(precompute_resolution=None): function _create_vit_backbone (line 72) | def _create_vit_backbone(compile_mode=None): function _create_vit_neck (line 102) | def _create_vit_neck(position_encoding, vit_backbone, enable_inst_intera... function _create_vl_backbone (line 113) | def _create_vl_backbone(vit_neck, text_encoder): function _create_transformer_encoder (line 118) | def _create_transformer_encoder() -> TransformerEncoderFusion: function _create_transformer_decoder (line 156) | def _create_transformer_decoder() -> TransformerDecoder: function _create_dot_product_scoring (line 193) | def _create_dot_product_scoring(): function _create_segmentation_head (line 207) | def _create_segmentation_head(compile_mode=None): function _create_geometry_encoder (line 235) | def _create_geometry_encoder(): function _create_sam3_model (line 291) | def _create_sam3_model( function _create_tracker_maskmem_backbone (line 333) | def _create_tracker_maskmem_backbone(): function _create_tracker_transformer (line 369) | def _create_tracker_transformer(): function build_tracker (line 434) | def build_tracker( function _create_text_encoder (line 489) | def _create_text_encoder(bpe_path: str) -> VETextEncoder: function _create_vision_backbone (line 501) | def _create_vision_backbone( function _create_sam3_transformer (line 518) | def _create_sam3_transformer(has_presence_token: bool = True) -> Transfo... function _load_checkpoint (line 526) | def _load_checkpoint(model, checkpoint_path): function _setup_device_and_mode (line 551) | def _setup_device_and_mode(model, device, eval_mode): function build_sam3_image_model (line 560) | def build_sam3_image_model( function download_ckpt_from_hf (line 644) | def download_ckpt_from_hf(): function build_sam3_video_model (line 653) | def build_sam3_video_model( function build_sam3_video_predictor (line 794) | def build_sam3_video_predictor(*model_args, gpus_to_use=None, **model_kw... FILE: sam3/perflib/associate_det_trk.py function associate_det_trk (line 13) | def associate_det_trk( FILE: sam3/perflib/compile.py function recursive_fn_factory (line 8) | def recursive_fn_factory(fn): function compile_wrapper (line 37) | def compile_wrapper( function shape_logging_wrapper (line 55) | def shape_logging_wrapper(fn, keep_kwargs, enable_logging=False): FILE: sam3/perflib/connected_components.py function connected_components_cpu_single (line 20) | def connected_components_cpu_single(values: torch.Tensor): function connected_components_cpu (line 34) | def connected_components_cpu(input_tensor: torch.Tensor): function connected_components (line 55) | def connected_components(input_tensor: torch.Tensor): FILE: sam3/perflib/fa3.py function flash_attn_func_op (line 9) | def flash_attn_func_op( function flash_attn_func (line 17) | def flash_attn_func(q, k, v): function _ (line 23) | def _(q, k, v, **kwargs): FILE: sam3/perflib/masks_ops.py function masks_to_boxes (line 8) | def masks_to_boxes(masks: torch.Tensor, obj_ids: list[int]): function mask_iou (line 50) | def mask_iou(pred_masks: torch.Tensor, gt_masks: torch.Tensor) -> torch.... FILE: sam3/perflib/nms.py function nms_masks (line 24) | def nms_masks( function generic_nms (line 56) | def generic_nms( function generic_nms_cpu (line 75) | def generic_nms_cpu( FILE: sam3/perflib/tests/tests.py class TestMasksToBoxes (line 14) | class TestMasksToBoxes: method test_masks_box (line 15) | def test_masks_box(self): FILE: sam3/perflib/triton/connected_components.py function _any_combine (line 12) | def _any_combine(a, b): function tl_any (line 17) | def tl_any(a, dim=0): function _init_labels_kernel (line 31) | def _init_labels_kernel( function find (line 51) | def find(labels_ptr, indices, mask): function union (line 77) | def union(labels_ptr, a, b, process_mask): function _merge_helper (line 142) | def _merge_helper( function _local_prop_kernel (line 206) | def _local_prop_kernel( function _pointer_jump_kernel (line 321) | def _pointer_jump_kernel( function _count_labels_kernel (line 365) | def _count_labels_kernel(labels_ptr, sizes_ptr, numel, BLOCK_SIZE: tl.co... function _broadcast_sizes_kernel (line 380) | def _broadcast_sizes_kernel( function connected_components_triton (line 398) | def connected_components_triton(input_tensor: torch.Tensor): FILE: sam3/perflib/triton/nms.py function _nms_suppression_kernel (line 25) | def _nms_suppression_kernel( function nms_triton (line 84) | def nms_triton( FILE: sam3/sam/common.py class MLPBlock (line 11) | class MLPBlock(nn.Module): method __init__ (line 12) | def __init__( method forward (line 23) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 29) | class LayerNorm2d(nn.Module): method __init__ (line 30) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 36) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: sam3/sam/mask_decoder.py class MaskDecoder (line 14) | class MaskDecoder(nn.Module): method __init__ (line 15) | def __init__( method forward (line 109) | def forward( method predict_masks (line 167) | def predict_masks( method _get_stability_scores (line 246) | def _get_stability_scores(self, mask_logits): method _dynamic_multimask_via_stability (line 258) | def _dynamic_multimask_via_stability(self, all_mask_logits, all_iou_sc... class MLP (line 299) | class MLP(nn.Module): method __init__ (line 300) | def __init__( method forward (line 316) | def forward(self, x): FILE: sam3/sam/prompt_encoder.py class PromptEncoder (line 14) | class PromptEncoder(nn.Module): method __init__ (line 15) | def __init__( method get_dense_pe (line 65) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 76) | def _embed_points( method _embed_boxes (line 120) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 131) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 136) | def _get_batch_size( method _get_device (line 154) | def _get_device(self) -> torch.device: method forward (line 157) | def forward( class PositionEmbeddingRandom (line 202) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 207) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 216) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 225) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 238) | def forward_with_coords( FILE: sam3/sam/rope.py function init_t_xy (line 19) | def init_t_xy(end_x: int, end_y: int, scale: float = 1.0, offset: int = ... function compute_axial_cis (line 26) | def compute_axial_cis( function reshape_for_broadcast (line 50) | def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor): function apply_rotary_enc (line 58) | def apply_rotary_enc( function complex_mult (line 83) | def complex_mult(xq_real, xq_imag, freqs_cis_real, freqs_cis_imag): function apply_rotary_enc_real (line 92) | def apply_rotary_enc_real( function broadcat (line 120) | def broadcat(tensors, dim=-1): function rotate_half (line 125) | def rotate_half(x: torch.Tensor): class VisionRotaryEmbeddingVE (line 132) | class VisionRotaryEmbeddingVE(nn.Module): method __init__ (line 133) | def __init__( method forward (line 162) | def forward(self, t: torch.Tensor): FILE: sam3/sam/transformer.py class TwoWayTransformer (line 17) | class TwoWayTransformer(nn.Module): method __init__ (line 18) | def __init__( method forward (line 63) | def forward( class TwoWayAttentionBlock (line 110) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 111) | def __init__( method forward (line 152) | def forward( class Attention (line 186) | class Attention(nn.Module): method __init__ (line 192) | def __init__( method _separate_heads (line 218) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 223) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 228) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: class RoPEAttention (line 267) | class RoPEAttention(Attention): method __init__ (line 270) | def __init__( method forward (line 295) | def forward( FILE: sam3/train/data/coco_json_loaders.py function convert_boxlist_to_normalized_tensor (line 18) | def convert_boxlist_to_normalized_tensor(box_list, image_width, image_he... function load_coco_and_group_by_image (line 37) | def load_coco_and_group_by_image(json_path: str) -> Tuple[List[Dict], Di... function ann_to_rle (line 72) | def ann_to_rle(segm, im_info: Dict) -> Dict: class COCO_FROM_JSON (line 104) | class COCO_FROM_JSON: method __init__ (line 110) | def __init__( method getDatapointIds (line 149) | def getDatapointIds(self): method loadQueriesAndAnnotationsFromDatapoint (line 153) | def loadQueriesAndAnnotationsFromDatapoint(self, idx): method loadImagesFromDatapoint (line 255) | def loadImagesFromDatapoint(self, idx): class SAM3_EVAL_API_FROM_JSON_NP (line 283) | class SAM3_EVAL_API_FROM_JSON_NP: method __init__ (line 288) | def __init__(self, annotation_file): method getDatapointIds (line 299) | def getDatapointIds(self): method loadQueriesAndAnnotationsFromDatapoint (line 303) | def loadQueriesAndAnnotationsFromDatapoint(self, idx): method loadImagesFromDatapoint (line 342) | def loadImagesFromDatapoint(self, idx): class SAM3_VEVAL_API_FROM_JSON_NP (line 364) | class SAM3_VEVAL_API_FROM_JSON_NP: method __init__ (line 369) | def __init__(self, annotation_file): method getDatapointIds (line 397) | def getDatapointIds(self): method loadQueriesAndAnnotationsFromDatapoint (line 401) | def loadQueriesAndAnnotationsFromDatapoint(self, idx): method loadImagesFromDatapoint (line 447) | def loadImagesFromDatapoint(self, idx): FILE: sam3/train/data/collator.py function convert_my_tensors (line 22) | def convert_my_tensors(obj): function packed_to_padded_naive (line 65) | def packed_to_padded_naive(boxes_packed, num_boxes, fill_value=0): function pad_tensor_list_to_longest (line 91) | def pad_tensor_list_to_longest( function collate_fn_api_with_chunking (line 107) | def collate_fn_api_with_chunking( function collate_fn_api (line 137) | def collate_fn_api( FILE: sam3/train/data/sam3_image_dataset.py class InferenceMetadata (line 30) | class InferenceMetadata: class FindQuery (line 58) | class FindQuery: class FindQueryLoaded (line 91) | class FindQueryLoaded(FindQuery): class Object (line 97) | class Object: class Image (line 116) | class Image: class Datapoint (line 126) | class Datapoint: class CustomCocoDetectionAPI (line 134) | class CustomCocoDetectionAPI(VisionDataset): method __init__ (line 148) | def __init__( method _load_images (line 180) | def _load_images( method set_curr_epoch (line 226) | def set_curr_epoch(self, epoch: int): method set_epoch (line 229) | def set_epoch(self, epoch: int): method set_sharded_annotation_file (line 232) | def set_sharded_annotation_file(self, data_epoch: int): method __getitem__ (line 253) | def __getitem__(self, index: int) -> Datapoint: method _load_datapoint (line 256) | def _load_datapoint(self, index: int) -> Datapoint: method load_queries (line 263) | def load_queries(self, pil_images, annotations, queries, img_metadata): method __len__ (line 434) | def __len__(self) -> int: class Sam3ImageDataset (line 438) | class Sam3ImageDataset(CustomCocoDetectionAPI): method __init__ (line 439) | def __init__( method __getitem__ (line 486) | def __getitem__(self, idx): method __orig_getitem__ (line 489) | def __orig_getitem__(self, idx): FILE: sam3/train/data/sam3_video_dataset.py class VideoGroundingDataset (line 29) | class VideoGroundingDataset(Sam3ImageDataset): method __init__ (line 30) | def __init__( method set_curr_epoch (line 89) | def set_curr_epoch(self, epoch: int): method _load_datapoint (line 93) | def _load_datapoint(self, index: int) -> Datapoint: method _sample_stage_ids (line 162) | def _sample_stage_ids(self, queries, num_stages_sample, stage_stride): method _filter_query_and_anns (line 190) | def _filter_query_and_anns( method _tile_single_image_data (line 235) | def _tile_single_image_data(self, datapoint: Datapoint, num_stages_sam... method _subsample_queries (line 301) | def _subsample_queries(self, datapoint: Datapoint, max_query_num: int): FILE: sam3/train/data/torch_dataset.py class TorchDataset (line 10) | class TorchDataset: method __init__ (line 11) | def __init__( method get_loader (line 37) | def get_loader(self, epoch) -> Iterable: FILE: sam3/train/loss/loss_fns.py function instance_masks_to_semantic_masks (line 30) | def instance_masks_to_semantic_masks( function accuracy (line 60) | def accuracy(output, target, topk=(1,)): function dice_loss (line 78) | def dice_loss(inputs, targets, num_boxes, loss_on_multimask=False, reduc... function _dice_loss (line 104) | def _dice_loss(inputs, targets, num_boxes, loss_on_multimask=False, redu... function sigmoid_focal_loss (line 125) | def sigmoid_focal_loss( function iou_loss (line 178) | def iou_loss( function _contrastive_align (line 199) | def _contrastive_align(logits, positive_map): function _get_src_permutation_idx (line 225) | def _get_src_permutation_idx(indices): class LossWithWeights (line 234) | class LossWithWeights(nn.Module): method __init__ (line 235) | def __init__(self, weight_dict, compute_aux, supports_o2m_loss=True): method forward (line 245) | def forward(self, *args, is_aux=False, **kwargs): method get_loss (line 252) | def get_loss(self, **kwargs): method reduce_loss (line 255) | def reduce_loss(self, losses): class IABCEMdetr (line 266) | class IABCEMdetr(LossWithWeights): method __init__ (line 267) | def __init__( method get_loss (line 348) | def get_loss(self, outputs, targets, indices, num_boxes): class Boxes (line 523) | class Boxes(LossWithWeights): method __init__ (line 524) | def __init__( method get_loss (line 536) | def get_loss(self, outputs, targets, indices, num_boxes): class Masks (line 573) | class Masks(LossWithWeights): method __init__ (line 574) | def __init__( method _sampled_loss (line 598) | def _sampled_loss(self, src_masks, target_masks, num_boxes): method get_loss (line 641) | def get_loss(self, outputs, targets, indices, num_boxes): function segment_miou (line 991) | def segment_miou(source, target): class SemanticSegCriterion (line 1005) | class SemanticSegCriterion(LossWithWeights): method __init__ (line 1006) | def __init__( method get_loss (line 1028) | def get_loss(self, out_dict, targets): class Det2TrkAssoc (line 1158) | class Det2TrkAssoc(LossWithWeights): method __init__ (line 1159) | def __init__( method get_loss (line 1173) | def get_loss(self, outputs, targets, indices, num_boxes): class TrackingByDetectionAssoc (line 1234) | class TrackingByDetectionAssoc(LossWithWeights): method __init__ (line 1235) | def __init__(self, weight_dict): method get_loss (line 1240) | def get_loss(self, outputs, targets, indices, num_boxes): function _keep_only_trk_queries_in_match_inds (line 1313) | def _keep_only_trk_queries_in_match_inds(inds, Q_det): FILE: sam3/train/loss/mask_sampling.py function point_sample (line 12) | def point_sample(input, point_coords, **kwargs): function get_uncertain_point_coords_with_randomness (line 40) | def get_uncertain_point_coords_with_randomness( function calculate_uncertainty (line 104) | def calculate_uncertainty(logits: torch.Tensor) -> torch.Tensor: FILE: sam3/train/loss/sam3_loss.py class DummyLoss (line 12) | class DummyLoss(torch.nn.Module): method __init__ (line 15) | def __init__( method forward (line 25) | def forward(self, *args, **kwargs): method accumulate (line 28) | def accumulate(self, out_dict): class Sam3LossWrapper (line 37) | class Sam3LossWrapper(torch.nn.Module): method __init__ (line 38) | def __init__( method _get_num_boxes (line 65) | def _get_num_boxes(self, targets): method compute_loss (line 83) | def compute_loss(self, nested_out, targets): method forward (line 161) | def forward(self, find_stages: SAM3Output, find_targets): FILE: sam3/train/loss/sigmoid_focal_loss.py function _inner_focal_loss_fwd (line 38) | def _inner_focal_loss_fwd(inputs, targets, alpha, gamma): function sigmoid_focal_loss_fwd_kernel (line 77) | def sigmoid_focal_loss_fwd_kernel( function sigmoid_focal_loss_fwd_kernel_reduce (line 103) | def sigmoid_focal_loss_fwd_kernel_reduce( function _inner_focal_loss_bwd (line 131) | def _inner_focal_loss_bwd(inputs, targets, alpha, gamma): function sigmoid_focal_loss_bwd_kernel (line 160) | def sigmoid_focal_loss_bwd_kernel( function sigmoid_focal_loss_bwd_kernel_reduce (line 187) | def sigmoid_focal_loss_bwd_kernel_reduce( class SigmoidFocalLoss (line 213) | class SigmoidFocalLoss(torch.autograd.Function): method forward (line 217) | def forward(ctx, inputs, targets, alpha=0.25, gamma=2): method backward (line 234) | def backward(ctx, grad_output): class SigmoidFocalLossReduced (line 265) | class SigmoidFocalLossReduced(torch.autograd.Function): method forward (line 270) | def forward(ctx, inputs, targets, alpha=0.25, gamma=2): method backward (line 297) | def backward(ctx, grad_output): FILE: sam3/train/masks_ops.py function instance_masks_to_semantic_masks (line 13) | def instance_masks_to_semantic_masks( function mask_intersection (line 39) | def mask_intersection(masks1, masks2, block_size=16): function mask_iom (line 59) | def mask_iom(masks1, masks2): function compute_boundary (line 74) | def compute_boundary(seg): function dilation (line 95) | def dilation(mask, kernel_size): function compute_F_measure (line 127) | def compute_F_measure( function rle_encode (line 163) | def rle_encode(orig_mask, return_areas=False): function robust_rle_encode (line 234) | def robust_rle_encode(masks): function ann_to_rle (line 255) | def ann_to_rle(segm, im_info): FILE: sam3/train/matcher.py function _do_matching (line 16) | def _do_matching(cost, repeats=1, return_tgt_indices=False, do_filtering... class HungarianMatcher (line 33) | class HungarianMatcher(nn.Module): method __init__ (line 41) | def __init__( method forward (line 70) | def forward(self, outputs, batched_targets): class BinaryHungarianMatcher (line 173) | class BinaryHungarianMatcher(nn.Module): method __init__ (line 181) | def __init__( method forward (line 204) | def forward(self, outputs, batched_targets, repeats=0, repeat_batch=1): class BinaryFocalHungarianMatcher (line 292) | class BinaryFocalHungarianMatcher(nn.Module): method __init__ (line 300) | def __init__( method forward (line 329) | def forward(self, outputs, batched_targets, repeats=1, repeat_batch=1): class BinaryHungarianMatcherV2 (line 432) | class BinaryHungarianMatcherV2(nn.Module): method __init__ (line 445) | def __init__( method forward (line 483) | def forward( class BinaryOneToManyMatcher (line 672) | class BinaryOneToManyMatcher(nn.Module): method __init__ (line 681) | def __init__( method forward (line 702) | def forward( FILE: sam3/train/nms_helper.py function is_zero_box (line 22) | def is_zero_box(bbox: list) -> bool: function convert_bbox_format (line 29) | def convert_bbox_format(bbox: list) -> List[float]: function process_track_level_nms (line 36) | def process_track_level_nms(video_groups: Dict, nms_threshold: float) ->... function process_frame_level_nms (line 79) | def process_frame_level_nms(video_groups: Dict, nms_threshold: float) ->... function compute_track_iou_matrix (line 121) | def compute_track_iou_matrix( function _compute_track_iou_matrix_numba (line 160) | def _compute_track_iou_matrix_numba(bboxes_stacked, valid_masks, areas): function apply_track_nms (line 190) | def apply_track_nms( function compute_frame_ious (line 216) | def compute_frame_ious(bbox: np.ndarray, bboxes: np.ndarray) -> np.ndarray: function _compute_frame_ious_numba (line 241) | def _compute_frame_ious_numba(bbox, bboxes): function apply_frame_nms (line 259) | def apply_frame_nms( function _apply_frame_nms_numba (line 289) | def _apply_frame_nms_numba(bboxes, scores, nms_threshold): FILE: sam3/train/optim/optimizer.py class Optimizer (line 31) | class Optimizer: method __init__ (line 32) | def __init__(self, optimizer, schedulers=None) -> None: method _validate_optimizer_schedulers (line 38) | def _validate_optimizer_schedulers(self): method step_schedulers (line 49) | def step_schedulers(self, where: float, step: int) -> None: method step (line 67) | def step(self, where, step, closure=None): method zero_grad (line 71) | def zero_grad(self, *args, **kwargs): function set_default_parameters (line 75) | def set_default_parameters( function name_constraints_to_parameters (line 109) | def name_constraints_to_parameters( function map_scheduler_cfgs_to_param_groups (line 128) | def map_scheduler_cfgs_to_param_groups( function validate_param_group_params (line 169) | def validate_param_group_params(param_groups: List[Dict], model: nn.Modu... function unix_module_cls_pattern_to_parameter_names (line 191) | def unix_module_cls_pattern_to_parameter_names( function unix_param_pattern_to_parameter_names (line 224) | def unix_param_pattern_to_parameter_names( function _unix_pattern_to_parameter_names (line 250) | def _unix_pattern_to_parameter_names( function get_module_cls_to_param_names (line 272) | def get_module_cls_to_param_names( function construct_optimizer (line 296) | def construct_optimizer( function get_full_parameter_name (line 371) | def get_full_parameter_name(module_name, param_name): class GradientClipper (line 377) | class GradientClipper: method __init__ (line 382) | def __init__(self, max_norm: float = 1.0, norm_type: int = 2): method __call__ (line 387) | def __call__(self, model: nn.Module): class ValueScaler (line 396) | class ValueScaler: method __init__ (line 397) | def __init__(self, scheduler, mult_val: float): method __call__ (line 401) | def __call__(self, *args, **kwargs): function rgetattr (line 406) | def rgetattr(obj, rattrs: str = None): function layer_decay_param_modifier (line 419) | def layer_decay_param_modifier( FILE: sam3/train/optim/schedulers.py class InverseSquareRootParamScheduler (line 8) | class InverseSquareRootParamScheduler: method __init__ (line 9) | def __init__( method __call__ (line 21) | def __call__(self, step: int, where: float): FILE: sam3/train/train.py class SlurmEvent (line 26) | class SlurmEvent: function handle_custom_resolving (line 34) | def handle_custom_resolving(cfg): function single_proc_run (line 44) | def single_proc_run(local_rank, main_port, cfg, world_size): function single_node_runner (line 60) | def single_node_runner(cfg, main_port: int): function format_exception (line 80) | def format_exception(e: Exception, limit=20): class SubmititRunner (line 85) | class SubmititRunner(submitit.helpers.Checkpointable): method __init__ (line 88) | def __init__(self, port, cfg): method run_trainer (line 93) | def run_trainer(self): method __call__ (line 111) | def __call__(self): method setup_job_info (line 122) | def setup_job_info(self, job_id, rank): function add_pythonpath_to_sys_path (line 134) | def add_pythonpath_to_sys_path(): function main (line 140) | def main(args) -> None: FILE: sam3/train/trainer.py function unwrap_ddp_if_wrapped (line 57) | def unwrap_ddp_if_wrapped(model): class OptimAMPConf (line 64) | class OptimAMPConf: class OptimConf (line 70) | class OptimConf: method __post_init__ (line 78) | def __post_init__(self): class DistributedConf (line 88) | class DistributedConf: class CudaConf (line 98) | class CudaConf: class CheckpointConf (line 109) | class CheckpointConf: method infer_missing (line 120) | def infer_missing(self): class LoggingConf (line 128) | class LoggingConf: class Trainer (line 141) | class Trainer: method __init__ (line 148) | def __init__( method _setup_timers (line 239) | def _setup_timers(self): method _get_meters (line 247) | def _get_meters(self, phase_filters=None): method _infer_distributed_backend_if_none (line 261) | def _infer_distributed_backend_if_none(self, distributed_conf, acceler... method _setup_env_variables (line 265) | def _setup_env_variables(self, env_variables_conf) -> None: method _setup_torch_dist_and_backend (line 270) | def _setup_torch_dist_and_backend(self, cuda_conf, distributed_conf) -... method _setup_device (line 289) | def _setup_device(self, accelerator): method _setup_ddp_distributed_training (line 299) | def _setup_ddp_distributed_training(self, distributed_conf, accelerator): method _move_to_device (line 322) | def _move_to_device(self): method save_checkpoint (line 333) | def save_checkpoint(self, epoch, checkpoint_names=None): method _save_checkpoint (line 377) | def _save_checkpoint(self, checkpoint, checkpoint_path): method load_checkpoint (line 396) | def load_checkpoint(self): method _init_model_state (line 405) | def _init_model_state(self): method _call_model_initializer (line 426) | def _call_model_initializer(self): method _load_resuming_checkpoint (line 436) | def _load_resuming_checkpoint(self, ckpt_path: str): method is_intermediate_val_epoch (line 461) | def is_intermediate_val_epoch(self, epoch): method _find_loss (line 469) | def _find_loss(self, key: str): method _find_meter (line 479) | def _find_meter(self, phase: str, key: str): method _step (line 488) | def _step( method run (line 552) | def run(self): method _setup_dataloaders (line 570) | def _setup_dataloaders(self): method run_train (line 580) | def run_train(self): method run_val (line 622) | def run_val(self): method val_epoch (line 639) | def val_epoch(self, val_loader, phase): method _get_trainer_state (line 753) | def _get_trainer_state(self, phase): method train_epoch (line 760) | def train_epoch(self, train_loader): method _log_sync_data_times (line 890) | def _log_sync_data_times(self, phase, data_times): method _run_step (line 901) | def _run_step( method _log_meters_and_save_best_ckpts (line 968) | def _log_meters_and_save_best_ckpts(self, phases: List[str]): method _log_timers (line 1000) | def _log_timers(self, phase): method _reset_meters (line 1029) | def _reset_meters(self, phases: str) -> None: method _check_val_key_match (line 1033) | def _check_val_key_match(self, val_keys, phase): method _setup_components (line 1056) | def _setup_components(self): method _construct_optimizers (line 1101) | def _construct_optimizers(self): method _log_loss_detailed_and_return_core_loss (line 1109) | def _log_loss_detailed_and_return_core_loss(self, loss, loss_str, step): function print_model_summary (line 1118) | def print_model_summary(model: torch.nn.Module, log_dir: str = ""): function get_human_readable_count (line 1156) | def get_human_readable_count(number: int) -> str: FILE: sam3/train/transforms/basic.py function crop (line 21) | def crop(image, target, region): function hflip (line 73) | def hflip(image, target): function resize (line 108) | def resize(image, target, size, max_size=None, square=False): function pad (line 182) | def pad(image, target, padding): class RandomCrop (line 223) | class RandomCrop: method __init__ (line 224) | def __init__(self, size): method __call__ (line 227) | def __call__(self, img, target): class RandomSizeCrop (line 232) | class RandomSizeCrop: method __init__ (line 233) | def __init__(self, min_size: int, max_size: int, respect_boxes: bool =... method __call__ (line 238) | def __call__(self, img: PIL.Image.Image, target: dict): class CenterCrop (line 292) | class CenterCrop: method __init__ (line 293) | def __init__(self, size): method __call__ (line 296) | def __call__(self, img, target): class RandomHorizontalFlip (line 304) | class RandomHorizontalFlip: method __init__ (line 305) | def __init__(self, p=0.5): method __call__ (line 308) | def __call__(self, img, target): class RandomResize (line 314) | class RandomResize: method __init__ (line 315) | def __init__(self, sizes, max_size=None, square=False): method __call__ (line 323) | def __call__(self, img, target=None): class RandomPad (line 328) | class RandomPad: method __init__ (line 329) | def __init__(self, max_pad): method __call__ (line 332) | def __call__(self, img, target): class PadToSize (line 338) | class PadToSize: method __init__ (line 339) | def __init__(self, size): method __call__ (line 342) | def __call__(self, img, target): class Identity (line 354) | class Identity: method __call__ (line 355) | def __call__(self, img, target): class RandomSelect (line 359) | class RandomSelect: method __init__ (line 365) | def __init__(self, transforms1=None, transforms2=None, p=0.5): method __call__ (line 370) | def __call__(self, img, target): class ToTensor (line 376) | class ToTensor: method __call__ (line 377) | def __call__(self, img, target): class RandomErasing (line 381) | class RandomErasing: method __init__ (line 382) | def __init__(self, *args, **kwargs): method __call__ (line 385) | def __call__(self, img, target): class Normalize (line 389) | class Normalize: method __init__ (line 390) | def __init__(self, mean, std): method __call__ (line 394) | def __call__(self, image, target=None): class RemoveDifficult (line 413) | class RemoveDifficult: method __init__ (line 414) | def __init__(self, enabled=False): method __call__ (line 417) | def __call__(self, image, target=None): class Compose (line 429) | class Compose: method __init__ (line 430) | def __init__(self, transforms): method __call__ (line 433) | def __call__(self, image, target): method __repr__ (line 438) | def __repr__(self): function get_random_resize_scales (line 447) | def get_random_resize_scales(size, min_size, rounded): function get_random_resize_max_size (line 454) | def get_random_resize_max_size(size, ratio=5 / 3): FILE: sam3/train/transforms/basic_for_api.py function crop (line 25) | def crop( function hflip (line 115) | def hflip(datapoint, index): function get_size_with_aspect_ratio (line 144) | def get_size_with_aspect_ratio(image_size, size, max_size=None): function resize (line 165) | def resize(datapoint, index, size, max_size=None, square=False, v2=False): function pad (line 239) | def pad(datapoint, index, padding, v2=False): class RandomSizeCropAPI (line 328) | class RandomSizeCropAPI: method __init__ (line 329) | def __init__( method _sample_no_respect_boxes (line 347) | def _sample_no_respect_boxes(self, img): method _sample_respect_boxes (line 352) | def _sample_respect_boxes(self, img, boxes, points, min_box_size=10.0): method __call__ (line 411) | def __call__(self, datapoint, **kwargs): class CenterCropAPI (line 540) | class CenterCropAPI: method __init__ (line 541) | def __init__(self, size, consistent_transform, recompute_box_from_mask... method _sample_crop (line 546) | def _sample_crop(self, image_width, image_height): method __call__ (line 552) | def __call__(self, datapoint, **kwargs): class RandomHorizontalFlip (line 582) | class RandomHorizontalFlip: method __init__ (line 583) | def __init__(self, consistent_transform, p=0.5): method __call__ (line 587) | def __call__(self, datapoint, **kwargs): class RandomResizeAPI (line 599) | class RandomResizeAPI: method __init__ (line 600) | def __init__( method __call__ (line 612) | def __call__(self, datapoint, **kwargs): class ScheduledRandomResizeAPI (line 628) | class ScheduledRandomResizeAPI(RandomResizeAPI): method __init__ (line 629) | def __init__(self, size_scheduler, consistent_transform, square=False): method __call__ (line 636) | def __call__(self, datapoint, **kwargs): class RandomPadAPI (line 646) | class RandomPadAPI: method __init__ (line 647) | def __init__(self, max_pad, consistent_transform): method _sample_pad (line 651) | def _sample_pad(self): method __call__ (line 656) | def __call__(self, datapoint, **kwargs): class PadToSizeAPI (line 669) | class PadToSizeAPI: method __init__ (line 670) | def __init__(self, size, consistent_transform, bottom_right=False, v2=... method _sample_pad (line 676) | def _sample_pad(self, w, h): method __call__ (line 686) | def __call__(self, datapoint, **kwargs): class RandomMosaicVideoAPI (line 714) | class RandomMosaicVideoAPI: method __init__ (line 715) | def __init__(self, prob=0.15, grid_h=2, grid_w=2, use_random_hflip=Fal... method __call__ (line 721) | def __call__(self, datapoint, **kwargs): function random_mosaic_frame (line 747) | def random_mosaic_frame( class ScheduledPadToSizeAPI (line 832) | class ScheduledPadToSizeAPI(PadToSizeAPI): method __init__ (line 833) | def __init__(self, size_scheduler, consistent_transform): method __call__ (line 838) | def __call__(self, datapoint, **kwargs): class IdentityAPI (line 845) | class IdentityAPI: method __call__ (line 846) | def __call__(self, datapoint, **kwargs): class RandomSelectAPI (line 850) | class RandomSelectAPI: method __init__ (line 856) | def __init__(self, transforms1=None, transforms2=None, p=0.5): method __call__ (line 861) | def __call__(self, datapoint, **kwargs): class ToTensorAPI (line 867) | class ToTensorAPI: method __init__ (line 868) | def __init__(self, v2=False): method __call__ (line 871) | def __call__(self, datapoint: Datapoint, **kwargs): class NormalizeAPI (line 882) | class NormalizeAPI: method __init__ (line 883) | def __init__(self, mean, std, v2=False): method __call__ (line 888) | def __call__(self, datapoint: Datapoint, **kwargs): class ComposeAPI (line 922) | class ComposeAPI: method __init__ (line 923) | def __init__(self, transforms): method __call__ (line 926) | def __call__(self, datapoint, **kwargs): method __repr__ (line 931) | def __repr__(self): class RandomGrayscale (line 940) | class RandomGrayscale: method __init__ (line 941) | def __init__(self, consistent_transform, p=0.5): method __call__ (line 946) | def __call__(self, datapoint: Datapoint, **kwargs): class ColorJitter (line 958) | class ColorJitter: method __init__ (line 959) | def __init__(self, consistent_transform, brightness, contrast, saturat... method __call__ (line 978) | def __call__(self, datapoint: Datapoint, **kwargs): class RandomAffine (line 1013) | class RandomAffine: method __init__ (line 1014) | def __init__( method __call__ (line 1048) | def __call__(self, datapoint: Datapoint, **kwargs): method transform_datapoint (line 1060) | def transform_datapoint(self, datapoint: Datapoint): class RandomResizedCrop (line 1123) | class RandomResizedCrop: method __init__ (line 1124) | def __init__( method __call__ (line 1154) | def __call__(self, datapoint: Datapoint, **kwargs): method transform_datapoint (line 1166) | def transform_datapoint(self, datapoint: Datapoint): class ResizeToMaxIfAbove (line 1231) | class ResizeToMaxIfAbove: method __init__ (line 1233) | def __init__( method __call__ (line 1239) | def __call__(self, datapoint: Datapoint, **kwargs): function get_bbox_xyxy_abs_coords_from_mask (line 1269) | def get_bbox_xyxy_abs_coords_from_mask(mask): class MotionBlur (line 1288) | class MotionBlur: method __init__ (line 1289) | def __init__(self, kernel_size=5, consistent_transform=True, p=0.5): method __call__ (line 1295) | def __call__(self, datapoint: Datapoint, **kwargs): method _generate_motion_blur_kernel (line 1309) | def _generate_motion_blur_kernel(self): method _apply_motion_blur (line 1322) | def _apply_motion_blur(self, image, kernel): class LargeScaleJitter (line 1336) | class LargeScaleJitter: method __init__ (line 1337) | def __init__( method __call__ (line 1359) | def __call__(self, datapoint: Datapoint, **kwargs): FILE: sam3/train/transforms/filter_query_transforms.py class FilterDataPointQueries (line 14) | class FilterDataPointQueries: method identify_queries_to_filter (line 19) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: method _do_filter_query (line 25) | def _do_filter_query(self, query: Union[FindQuery], query_id: int): class FilterQueryWithText (line 31) | class FilterQueryWithText(FilterDataPointQueries): method __init__ (line 36) | def __init__( method identify_queries_to_filter (line 42) | def identify_queries_to_filter(self, datapoint): class KeepMaxNumFindQueries (line 53) | class KeepMaxNumFindQueries(FilterDataPointQueries): method __init__ (line 54) | def __init__( method identify_queries_to_filter (line 60) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: class KeepMaxNumFindQueriesVideo (line 104) | class KeepMaxNumFindQueriesVideo(FilterDataPointQueries): method __init__ (line 105) | def __init__( method identify_queries_to_filter (line 115) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: class KeepSemanticFindQueriesOnly (line 195) | class KeepSemanticFindQueriesOnly(FilterDataPointQueries): method identify_queries_to_filter (line 196) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: class KeepUnaryFindQueriesOnly (line 205) | class KeepUnaryFindQueriesOnly(FilterDataPointQueries): method identify_queries_to_filter (line 206) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: class FilterZeroBoxQueries (line 213) | class FilterZeroBoxQueries(FilterDataPointQueries): method _is_zero_area_object (line 219) | def _is_zero_area_object(obj: Object): method identify_queries_to_filter (line 227) | def identify_queries_to_filter(self, datapoint): class FilterFindQueriesWithTooManyOut (line 249) | class FilterFindQueriesWithTooManyOut(FilterDataPointQueries): method __init__ (line 254) | def __init__(self, max_num_objects: int): method identify_queries_to_filter (line 257) | def identify_queries_to_filter(self, datapoint): class FilterEmptyTargets (line 269) | class FilterEmptyTargets(FilterDataPointQueries): method identify_queries_to_filter (line 274) | def identify_queries_to_filter(self, datapoint): class FilterNonExhaustiveFindQueries (line 284) | class FilterNonExhaustiveFindQueries(FilterDataPointQueries): method __init__ (line 289) | def __init__(self, exhaustivity_type: str): method identify_queries_to_filter (line 300) | def identify_queries_to_filter(self, datapoint): class FilterInvalidGeometricQueries (line 320) | class FilterInvalidGeometricQueries(FilterDataPointQueries): method identify_queries_to_filter (line 325) | def identify_queries_to_filter(self, datapoint): class FlexibleFilterFindGetQueries (line 337) | class FlexibleFilterFindGetQueries: method __init__ (line 338) | def __init__( method __call__ (line 344) | def __call__(self, datapoint, **kwargs): class AddPrefixSuffixToFindText (line 465) | class AddPrefixSuffixToFindText: method __init__ (line 473) | def __init__( method __call__ (line 494) | def __call__(self, datapoint, **kwargs): class FilterCrowds (line 518) | class FilterCrowds(FilterDataPointQueries): method identify_queries_to_filter (line 519) | def identify_queries_to_filter(self, datapoint: Datapoint) -> None: class TextQueryToVisual (line 532) | class TextQueryToVisual: method __init__ (line 537) | def __init__(self, probability, keep_text_queries=False) -> None: method __call__ (line 542) | def __call__(self, datapoint: Datapoint, **kwargs): class RemoveInputBoxes (line 570) | class RemoveInputBoxes: method __init__ (line 575) | def __init__(self) -> None: method __call__ (line 578) | def __call__(self, datapoint: Datapoint, **kwargs): class OverwriteTextQuery (line 590) | class OverwriteTextQuery: method __init__ (line 595) | def __init__(self, target_text, probability=1.0) -> None: method __call__ (line 600) | def __call__(self, datapoint: Datapoint, **kwargs): FILE: sam3/train/transforms/point_sampling.py function sample_points_from_rle (line 14) | def sample_points_from_rle(rle, n_points, mode, box=None, normalize=True): function sample_points_from_mask (line 35) | def sample_points_from_mask(mask, n_points, mode, box=None): function uniform_positive_sample (line 48) | def uniform_positive_sample(mask, n_points): function center_positive_sample (line 67) | def center_positive_sample(mask, n_points): function uniform_sample_from_box (line 96) | def uniform_sample_from_box(mask, box, n_points): function rescale_box_xyxy (line 115) | def rescale_box_xyxy(box, factor, imsize=None): function noise_box (line 137) | def noise_box(box, im_size, box_noise_std, box_noise_max, min_box_area): class RandomGeometricInputsAPI (line 157) | class RandomGeometricInputsAPI: method __init__ (line 196) | def __init__( method _sample_num_points_and_if_box (line 229) | def _sample_num_points_and_if_box(self): method _get_original_box (line 243) | def _get_original_box(self, target_object): method _get_target_object (line 249) | def _get_target_object(self, datapoint, query): method __call__ (line 258) | def __call__(self, datapoint, **kwargs): class RandomizeInputBbox (line 310) | class RandomizeInputBbox: method __init__ (line 315) | def __init__( method __call__ (line 325) | def __call__(self, datapoint: Datapoint, **kwargs): FILE: sam3/train/transforms/segmentation.py class InstanceToSemantic (line 14) | class InstanceToSemantic(object): method __init__ (line 17) | def __init__(self, delete_instance=True, use_rle=False): method __call__ (line 21) | def __call__(self, datapoint: Datapoint, **kwargs): class RecomputeBoxesFromMasks (line 68) | class RecomputeBoxesFromMasks: method __call__ (line 71) | def __call__(self, datapoint: Datapoint, **kwargs): class DecodeRle (line 82) | class DecodeRle: method __call__ (line 90) | def __call__(self, datapoint: Datapoint, **kwargs): FILE: sam3/train/utils/checkpoint_utils.py function unix_pattern_to_parameter_names (line 29) | def unix_pattern_to_parameter_names( function filter_params_matching_unix_pattern (line 46) | def filter_params_matching_unix_pattern( function exclude_params_matching_unix_pattern (line 67) | def exclude_params_matching_unix_pattern( function _get_state_dict_summary (line 88) | def _get_state_dict_summary(state_dict: Dict[str, torch.Tensor]): function assert_skipped_parameters_are_frozen (line 98) | def assert_skipped_parameters_are_frozen(model: nn.Module, patterns: Lis... function with_check_parameter_frozen (line 122) | def with_check_parameter_frozen( class CkptExcludeKernel (line 163) | class CkptExcludeKernel: method __init__ (line 172) | def __init__(self, key_pattern: List[str]): method __call__ (line 175) | def __call__(self, state_dict: Dict): function load_checkpoint (line 188) | def load_checkpoint( function get_state_dict (line 226) | def get_state_dict(checkpoint, ckpt_state_dict_keys): function load_checkpoint_and_apply_kernels (line 246) | def load_checkpoint_and_apply_kernels( function check_load_state_dict_errors (line 296) | def check_load_state_dict_errors( function load_state_dict_into_model (line 329) | def load_state_dict_into_model( FILE: sam3/train/utils/distributed.py function _get_global_gloo_group (line 35) | def _get_global_gloo_group(): function is_main_process (line 54) | def is_main_process(): function all_gather_via_filesys (line 59) | def all_gather_via_filesys(data, filesys_save_dir=None, gather_to_rank_0... function all_gather (line 118) | def all_gather(data, force_cpu=False, force_filesys=False, filesys_save_... function convert_to_distributed_tensor (line 190) | def convert_to_distributed_tensor(tensor: torch.Tensor) -> Tuple[torch.T... function convert_to_normal_tensor (line 206) | def convert_to_normal_tensor(tensor: torch.Tensor, orig_device: str) -> ... function is_distributed_training_run (line 216) | def is_distributed_training_run() -> bool: function is_primary (line 224) | def is_primary() -> bool: function all_reduce_mean (line 232) | def all_reduce_mean(tensor: torch.Tensor) -> torch.Tensor: function all_reduce_sum (line 244) | def all_reduce_sum(tensor: torch.Tensor) -> torch.Tensor: function all_reduce_min (line 253) | def all_reduce_min(tensor: torch.Tensor) -> torch.Tensor: function all_reduce_max (line 262) | def all_reduce_max(tensor: torch.Tensor) -> torch.Tensor: function all_reduce_op (line 271) | def all_reduce_op( function gather_tensors_from_all (line 290) | def gather_tensors_from_all(tensor: torch.Tensor) -> List[torch.Tensor]: function gather_from_all (line 316) | def gather_from_all(tensor: torch.Tensor) -> torch.Tensor: function broadcast (line 322) | def broadcast(tensor: torch.Tensor, src: int = 0) -> torch.Tensor: function barrier (line 334) | def barrier() -> None: function get_world_size (line 344) | def get_world_size() -> int: function get_rank (line 356) | def get_rank() -> int: function get_primary_rank (line 368) | def get_primary_rank() -> int: function set_cuda_device_index (line 372) | def set_cuda_device_index(idx: int) -> None: function set_cpu_device (line 378) | def set_cpu_device() -> None: function get_cuda_device_index (line 383) | def get_cuda_device_index() -> int: function init_distributed_data_parallel_model (line 387) | def init_distributed_data_parallel_model( function broadcast_object (line 415) | def broadcast_object(obj: Any, src: int = _PRIMARY_RANK, use_disk: bool ... function all_gather_tensor (line 455) | def all_gather_tensor(tensor: torch.Tensor, world_size=None): function all_gather_batch (line 469) | def all_gather_batch(tensors: List[torch.Tensor]): class GatherLayer (line 489) | class GatherLayer(autograd.Function): method forward (line 496) | def forward(ctx, x): method backward (line 502) | def backward(ctx, *grads): function all_gather_batch_with_grad (line 508) | def all_gather_batch_with_grad(tensors): function unwrap_ddp_if_wrapped (line 530) | def unwrap_ddp_if_wrapped(model): function create_new_process_group (line 536) | def create_new_process_group(group_size): function is_dist_avail_and_initialized (line 575) | def is_dist_avail_and_initialized(): function gather_to_rank_0_via_filesys (line 583) | def gather_to_rank_0_via_filesys(data, filesys_save_dir=None): FILE: sam3/train/utils/logger.py function make_tensorboard_logger (line 22) | def make_tensorboard_logger(log_dir: str, **writer_kwargs: Any): class TensorBoardWriterWrapper (line 30) | class TensorBoardWriterWrapper: method __init__ (line 35) | def __init__( method writer (line 77) | def writer(self) -> Optional[SummaryWriter]: method path (line 81) | def path(self) -> str: method flush (line 84) | def flush(self) -> None: method close (line 92) | def close(self) -> None: class TensorBoardLogger (line 104) | class TensorBoardLogger(TensorBoardWriterWrapper): method log_dict (line 109) | def log_dict(self, payload: Dict[str, Scalar], step: int) -> None: method log (line 121) | def log(self, name: str, data: Scalar, step: int) -> None: method log_hparams (line 133) | def log_hparams( class Logger (line 147) | class Logger: method __init__ (line 152) | def __init__(self, logging_conf): method log_dict (line 158) | def log_dict(self, payload: Dict[str, Scalar], step: int) -> None: method log (line 162) | def log(self, name: str, data: Scalar, step: int) -> None: method log_hparams (line 166) | def log_hparams( function _cached_log_stream (line 176) | def _cached_log_stream(filename): function setup_logging (line 185) | def setup_logging( function shutdown_logging (line 234) | def shutdown_logging(): FILE: sam3/train/utils/train_utils.py function multiply_all (line 22) | def multiply_all(*args): function collect_dict_keys (line 26) | def collect_dict_keys(config): class Phase (line 44) | class Phase: function register_omegaconf_resolvers (line 49) | def register_omegaconf_resolvers(): function setup_distributed_backend (line 64) | def setup_distributed_backend(backend, timeout_mins): function get_machine_local_and_dist_rank (line 79) | def get_machine_local_and_dist_rank(): function print_cfg (line 91) | def print_cfg(cfg): function set_seeds (line 99) | def set_seeds(seed_value, max_epochs, dist_rank): function makedir (line 114) | def makedir(dir_path): function is_dist_avail_and_initialized (line 128) | def is_dist_avail_and_initialized(): function get_amp_type (line 136) | def get_amp_type(amp_type: Optional[str] = None): function log_env_variables (line 146) | def log_env_variables(): class AverageMeter (line 156) | class AverageMeter: method __init__ (line 159) | def __init__(self, name, device, fmt=":f"): method reset (line 165) | def reset(self): method update (line 172) | def update(self, val, n=1): method __str__ (line 178) | def __str__(self): class MemMeter (line 183) | class MemMeter: method __init__ (line 186) | def __init__(self, name, device, fmt=":f"): method reset (line 192) | def reset(self): method update (line 200) | def update(self, n=1, reset_peak_usage=True): method __str__ (line 209) | def __str__(self): function human_readable_time (line 222) | def human_readable_time(time_seconds): class DurationMeter (line 230) | class DurationMeter: method __init__ (line 231) | def __init__(self, name, device, fmt=":f"): method reset (line 237) | def reset(self): method update (line 240) | def update(self, val): method add (line 243) | def add(self, val): method __str__ (line 246) | def __str__(self): class ProgressMeter (line 250) | class ProgressMeter: method __init__ (line 251) | def __init__(self, num_batches, meters, real_meters, prefix=""): method display (line 257) | def display(self, batch, enable_print=False): method _get_batch_fmtstr (line 273) | def _get_batch_fmtstr(self, num_batches): function get_resume_checkpoint (line 279) | def get_resume_checkpoint(checkpoint_save_dir): FILE: sam3/visualization_utils.py function generate_colors (line 24) | def generate_colors(n_colors=256, n_samples=5000): function show_img_tensor (line 47) | def show_img_tensor(img_batch, vis_img_idx=0): function draw_box_on_image (line 58) | def draw_box_on_image(image, box, color=(0, 255, 0)): function plot_bbox (line 92) | def plot_bbox( function plot_mask (line 147) | def plot_mask(mask, color="r", ax=None): function normalize_bbox (line 158) | def normalize_bbox(bbox_xywh, img_w, img_h): function visualize_frame_output (line 184) | def visualize_frame_output(frame_idx, video_frames, outputs, figsize=(12... function visualize_formatted_frame_output (line 207) | def visualize_formatted_frame_output( function render_masklet_frame (line 390) | def render_masklet_frame(img, outputs, frame_idx=None, alpha=0.5): function save_masklet_video (line 468) | def save_masklet_video(video_frames, outputs, out_path, alpha=0.5, fps=10): function save_masklet_image (line 502) | def save_masklet_image(frame, outputs, out_path, alpha=0.5, frame_idx=No... function prepare_masks_for_visualization (line 512) | def prepare_masks_for_visualization(frame_to_output): function convert_coco_to_masklet_format (line 523) | def convert_coco_to_masklet_format( function save_side_by_side_visualization (line 584) | def save_side_by_side_visualization(img, gt_anns, pred_anns, noun_phrase): function bitget (line 609) | def bitget(val, idx): function pascal_color_map (line 613) | def pascal_color_map(): function draw_masks_to_frame (line 624) | def draw_masks_to_frame( function get_annot_df (line 657) | def get_annot_df(file_path: str): function get_annot_dfs (line 673) | def get_annot_dfs(file_list: list[str]): function get_media_dir (line 682) | def get_media_dir(media_dir: str, dataset: str): function get_all_annotations_for_frame (line 695) | def get_all_annotations_for_frame( function visualize_prompt_overlay (line 742) | def visualize_prompt_overlay( function plot_results (line 858) | def plot_results(img, results): function single_visualization (line 879) | def single_visualization(img, anns, title): function show_mask (line 891) | def show_mask(mask, ax, obj_id=None, random_color=False): function show_box (line 903) | def show_box(box, ax): function show_points (line 911) | def show_points(coords, labels, ax, marker_size=375): function load_frame (line 934) | def load_frame(frame): FILE: scripts/eval/gold/eval_sam3.py function main (line 64) | def main(): FILE: scripts/eval/silver/download_fathomnet.py function download_imgs (line 15) | def download_imgs(args, image_uuids): function main (line 36) | def main(): FILE: scripts/eval/silver/download_inaturalist.py function download_archive (line 15) | def download_archive(url, dest_dir): function extract_archive (line 30) | def extract_archive(archive_path, dest_dir): function copy_images (line 37) | def copy_images(subset_json, untar_dir, output_dir): function main (line 52) | def main(): FILE: scripts/eval/silver/download_preprocess_nga.py function download_metadata (line 24) | def download_metadata(annotation_folder): function download_url (line 35) | def download_url(row): function download_item (line 45) | def download_item(item, output_folder): function remove_non_compliant_image (line 60) | def remove_non_compliant_image(item, output_folder): function reshape_image (line 72) | def reshape_image(rel_path, filename_size_map, output_folder): function main (line 82) | def main(args, workers=20): FILE: scripts/eval/silver/download_videos.py function construct_gcs_path (line 24) | def construct_gcs_path(original_video): function download_video (line 47) | def download_video(args): function download_youtube_video (line 64) | def download_youtube_video(youtube_id, output_path=None): function download_youtube (line 89) | def download_youtube(): function download_droid (line 134) | def download_droid(): function download_ego4d (line 164) | def download_ego4d(): function download_sav (line 232) | def download_sav(): function main (line 243) | def main(): FILE: scripts/eval/silver/extract_frames.py function extract_frame (line 28) | def extract_frame(path_video, global_frame_idx, path_frame, image_size, ... function process_image (line 39) | def process_image(args): function main (line 68) | def main(): FILE: scripts/eval/silver/preprocess_silver_geode_bdd100k_food_rec.py function main (line 13) | def main(args, n_workers=20): FILE: scripts/eval/silver/utils.py function load_yaml (line 36) | def load_yaml(filename): function load_json (line 41) | def load_json(filename): function save_json (line 46) | def save_json(content, filename): function run_command (line 51) | def run_command(cmd): function is_valid_image (line 61) | def is_valid_image(img_path): function get_frame_from_video (line 69) | def get_frame_from_video(video_path, frame_id): function update_annotations (line 95) | def update_annotations(dataset_name, file_names_keep, key="original_vide... function get_filename_size_map (line 119) | def get_filename_size_map(annotation_path): function get_filenames (line 128) | def get_filenames(annotation_path): function get_image_ids (line 135) | def get_image_ids(annotation_path): function setup (line 141) | def setup(folder): function copy_file (line 146) | def copy_file(paths): FILE: scripts/eval/standalone_cgf1.py function main (line 15) | def main(): FILE: scripts/eval/veval/saco_yt1b_annot_update.py function get_available_saco_yt1b_ids (line 15) | def get_available_saco_yt1b_ids(yt1b_meida_dir, data): function update_yt1b_annot_per_field (line 40) | def update_yt1b_annot_per_field(data, field, id_col, available_ids): function update_yt1b_annot (line 58) | def update_yt1b_annot(yt1b_input_annot_path, yt1b_media_dir, yt1b_output... function main (line 93) | def main(): FILE: scripts/eval/veval/saco_yt1b_downloader.py function download_and_extract_frames (line 17) | def download_and_extract_frames(saco_yt1b_id, args): function main (line 42) | def main(): FILE: scripts/eval/veval/saco_yt1b_frame_prep_util.py class YtVideoPrep (line 15) | class YtVideoPrep: method __init__ (line 16) | def __init__( method _get_yt_video_id_map_info (line 57) | def _get_yt_video_id_map_info(self): method download_youtube_video (line 82) | def download_youtube_video(self): method extract_frames_in_6fps_and_width_1080 (line 123) | def extract_frames_in_6fps_and_width_1080(self): function main (line 200) | def main(): FILE: scripts/extract_odinw_results.py function parse_args (line 39) | def parse_args(): function main (line 52) | def main(args): FILE: scripts/extract_roboflow_vl100_results.py function load_jsonl_last_row (line 145) | def load_jsonl_last_row(file_path: str, keys: List[str]) -> Optional[Dic... function find_config_files (line 180) | def find_config_files(directory: str, filename: str = CONFIG_FILENAME) -... function extract_config_parameters (line 201) | def extract_config_parameters(config_path: str, keys: List[str]) -> Dict... function calculate_average (line 236) | def calculate_average(values_dict: Dict[str, float]) -> float: function extract_category_results (line 251) | def extract_category_results(log_dir: str, categories: List[str]) -> Dic... function analyze_experiment_results (line 275) | def analyze_experiment_results(config_path: str) -> None: function print_results_table (line 330) | def print_results_table(results_data: List[Dict[str, Any]]) -> None: function main (line 347) | def main() -> None: