MCPcopy Create free account

hub / github.com/bowang-lab/MedSAM2 / functions

Functions862 in github.com/bowang-lab/MedSAM2

↓ 53 callersMethoditems
(self)
sam2/utils/amg.py:43
↓ 48 callersMethodupdate
(self, n=1, reset_peak_usage=True)
training/utils/train_utils.py:202
↓ 38 callersMethodcat
(self, new_stats: "MaskData")
sam2/utils/amg.py:61
↓ 35 callersMethodcat
(self, new_stats: "MaskData")
efficient_track_anything/utils/amg.py:61
↓ 23 callersMethodkeys
(self)
training/dataset/vos_segment_loader.py:258
↓ 22 callersMethodload
Load the single mask for the given frame index and convert it to binary segments. Args: frame_idx (int): Index of the fr
training/dataset/vos_segment_loader.py:314
↓ 12 callersMethod_separate_heads
(self, x: Tensor, num_heads: int)
efficient_track_anything/modeling/sam/transformer.py:223
↓ 10 callersMethodinit_state
Initializes the state variables for the video trainer. This method sets the initial state of various attributes used in the video
sam2/sam2_video_trainer.py:90
↓ 10 callersMethodreset_state
Resets the state of the video trainer. This method clears the internal state variables, setting them to their initial values:
sam2/sam2_video_trainer.py:114
↓ 10 callersFunctionstart_process
(session_id)
app.py:408
↓ 9 callersMethodforward_image
Get the image feature on the input batch.
sam2/modeling/sam2_base.py:467
↓ 9 callersMethodlog
(self, name: str, data: Scalar, step: int)
training/utils/logger.py:167
↓ 9 callersMethodpropagate_in_video
Propagate the input points across frames to track in the entire video.
sam2/sam2_video_predictor.py:663
↓ 8 callersMethod_prepare_backbone_features
Prepare and flatten visual features.
sam2/modeling/sam2_base.py:481
↓ 8 callersMethoddevice
(self)
sam2/modeling/sam2_base.py:198
↓ 8 callersMethoddevice
(self)
efficient_track_anything/modeling/efficienttam_base.py:201
↓ 8 callersMethodfilter
(self, keep: torch.Tensor)
efficient_track_anything/utils/amg.py:46
↓ 8 callersMethoditems
(self)
efficient_track_anything/utils/amg.py:43
↓ 7 callersMethodadd_new_mask
Add new mask to a frame.
sam2/sam2_video_predictor.py:321
↓ 7 callersMethodadd_new_points_or_box
Add new points to a frame.
sam2/sam2_video_predictor.py:173
↓ 6 callersMethod_apply_non_overlapping_constraints
Apply non-overlapping constraints to the object scores in pred_masks. Here we keep only the highest scoring object at each spatial lo
sam2/modeling/sam2_base.py:889
↓ 6 callersMethod_separate_heads
(self, x: Tensor, num_heads: int)
sam2/modeling/sam/transformer.py:245
↓ 6 callersFunctionclear_folder
(folder_path)
app.py:255
↓ 6 callersFunctionget_world_size
Simple wrapper for correctly getting worldsize in both distributed / non-distributed settings
training/utils/distributed.py:340
↓ 6 callersFunctionmakedir
Create the directory if it does not exist.
training/utils/train_utils.py:116
↓ 5 callersMethod__init__
( self, embedding_dim: int, num_heads: int, downsample_rate: int = 1,
efficient_track_anything/modeling/sam/transformer.py:199
↓ 5 callersMethod_apply_non_overlapping_constraints
Apply non-overlapping constraints to the object scores in pred_masks. Here we keep only the highest scoring object at each spatial lo
efficient_track_anything/modeling/efficienttam_base.py:893
↓ 5 callersMethod_consolidate_temp_output_across_obj
Consolidate the per-object temporary outputs in `temp_output_dict_per_obj` on a frame into a single output for all objects, including
sam2/sam2_video_predictor_npz.py:430
↓ 5 callersMethod_consolidate_temp_output_across_obj
Consolidate the per-object temporary outputs in `temp_output_dict_per_obj` on a frame into a single output for all objects, including
sam2/sam2_video_predictor.py:426
↓ 5 callersMethod_get_orig_video_res_output
Resize the object scores to the original video resolution (video_res_masks) and apply non-overlapping constraints for final output.
sam2/sam2_video_predictor_npz.py:408
↓ 5 callersMethod_get_orig_video_res_output
Resize the object scores to the original video resolution (video_res_masks) and apply non-overlapping constraints for final output.
sam2/sam2_video_predictor.py:404
↓ 5 callersMethod_get_orig_video_res_output
Resize the object scores to the original video resolution (video_res_masks) and apply non-overlapping constraints for final output.
efficient_track_anything/efficienttam_video_predictor.py:392
↓ 5 callersMethod_get_orig_video_res_output
Resize the object scores to the original video resolution (video_res_masks) and apply non-overlapping constraints for final output.
efficient_track_anything/efficienttam_video_predictor_npz.py:395
↓ 5 callersMethodget_dense_pe
Returns the positional encoding used to encode point prompts, applied to a dense set of points the shape of the image encoding.
sam2/modeling/sam/prompt_encoder.py:68
↓ 5 callersFunctionget_rank
Simple wrapper for correctly getting rank in both distributed / non-distributed settings
training/utils/distributed.py:352
↓ 5 callersFunctionunix_pattern_to_parameter_names
Go through the list of parameter names and select those that match any of the provided constraints
training/utils/checkpoint_utils.py:30
↓ 5 callersFunctionunwrap_ddp_if_wrapped
(model)
training/trainer.py:60
↓ 4 callersMethod_consolidate_temp_output_across_obj
Consolidate the per-object temporary outputs in `temp_output_dict_per_obj` on a frame into a single output for all objects, including
efficient_track_anything/efficienttam_video_predictor.py:414
↓ 4 callersMethod_consolidate_temp_output_across_obj
Consolidate the per-object temporary outputs in `temp_output_dict_per_obj` on a frame into a single output for all objects, including
efficient_track_anything/efficienttam_video_predictor_npz.py:417
↓ 4 callersMethod_forward_sam_heads
Forward SAM prompt encoders and mask heads. Inputs: - backbone_features: image features of [B, C, H, W] shape - poin
sam2/modeling/sam2_base.py:257
↓ 4 callersMethod_get_image_feature
Compute the image features on a given frame.
sam2/sam2_video_predictor_npz.py:883
↓ 4 callersMethod_get_image_feature
Compute the image features on a given frame.
sam2/sam2_video_predictor.py:879
↓ 4 callersMethod_get_meters
(self, phase_filters=None)
training/trainer.py:239
↓ 4 callersMethod_get_obj_num
Get the total number of unique object ids received so far in this session.
sam2/sam2_video_predictor_npz.py:172
↓ 4 callersMethod_get_obj_num
Get the total number of unique object ids received so far in this session.
sam2/sam2_video_predictor.py:168
↓ 4 callersMethod_get_obj_num
Get the total number of unique object ids received so far in this session.
efficient_track_anything/efficienttam_video_predictor.py:165
↓ 4 callersMethod_get_obj_num
Get the total number of unique object ids received so far in this session.
efficient_track_anything/efficienttam_video_predictor_npz.py:168
↓ 4 callersMethod_predict
Predict masks for the given input prompts, using the currently set image. Input prompts are batched torch tensors and are expected to
efficient_track_anything/efficienttam_image_predictor.py:343
↓ 4 callersMethod_prepare_backbone_features
Prepare and flatten visual features.
efficient_track_anything/modeling/efficienttam_base.py:483
↓ 4 callersMethod_recombine_heads
(self, x: Tensor)
efficient_track_anything/modeling/sam/transformer.py:228
↓ 4 callersFunctionall_reduce_op
Wrapper over torch.distributed.all_reduce for performing reduction of tensor over all processes in both distributed / non-distributed sce
training/utils/distributed.py:267
↓ 4 callersFunctionbroadcast
Wrapper over torch.distributed.broadcast for broadcasting a tensor from the source to all processes in both distributed / non-distributed sce
training/utils/distributed.py:318
↓ 4 callersFunctionbuild_sam2_video_predictor
( config_file, ckpt_path=None, device=None, mode="eval", hydra_overrides_extra=[], app
sam2/build_sam.py:95
↓ 4 callersFunctionconcat_points
Add new points and labels to previous point inputs (add at the end).
sam2/utils/misc.py:341
↓ 4 callersFunctionconvert_to_distributed_tensor
For some backends, such as NCCL, communication only works if the tensor is on the GPU. This helper function converts to the correct devic
training/utils/distributed.py:186
↓ 4 callersFunctionconvert_to_normal_tensor
For some backends, such as NCCL, communication only works if the tensor is on the GPU. This converts the tensor back to original device.
training/utils/distributed.py:202
↓ 4 callersMethodget_dense_pe
Returns the positional encoding used to encode point prompts, applied to a dense set of points the shape of the image encoding.
efficient_track_anything/modeling/sam/prompt_encoder.py:68
↓ 4 callersMethodrun
(self)
training/trainer.py:499
↓ 4 callersMethodrun_val
(self)
training/trainer.py:566
↓ 4 callersMethodsample
(self, video)
training/dataset/vos_sampler.py:27
↓ 4 callersFunctionshow_mask
(mask, image=None, obj_id=None)
app.py:206
↓ 4 callersMethodtrack_step
( self, frame_idx, is_init_cond_frame, current_vision_feats, current_v
sam2/modeling/sam2_base.py:812
↓ 4 callersMethodtransform_coords
Expects a torch tensor with length 2 in the last dimension. The coordinates can be in absolute image or normalized coordinates, If th
efficient_track_anything/utils/transforms.py:46
↓ 4 callersMethodupdate
(self, val, n=1)
training/utils/train_utils.py:174
↓ 3 callersMethod__init__
( self, input_dim: int, hidden_dim: int, output_dim: int, num_layers:
sam2/modeling/efficienttam_utils.py:113
↓ 3 callersMethod__init__
(self, layer, num_layers, dim=None, input_projection=False)
sam2/modeling/memory_encoder.py:121
↓ 3 callersMethod__init__
( self, embedding_dim: int, num_heads: int, downsample_rate: int = 1,
sam2/modeling/sam/transformer.py:221
↓ 3 callersMethod__init__
( self, input_dim: int, hidden_dim: int, output_dim: int, num_layers:
efficient_track_anything/modeling/efficienttam_utils.py:113
↓ 3 callersMethod__init__
(self, layer, num_layers, dim=None, input_projection=False)
efficient_track_anything/modeling/memory_encoder.py:125
↓ 3 callersMethod_add_output_per_object
Split a multi-object output into per-object output slices and add them into `output_dict_per_obj`. The resulting slices share the sam
sam2/sam2_video_predictor_npz.py:751
↓ 3 callersMethod_add_output_per_object
Split a multi-object output into per-object output slices and add them into `output_dict_per_obj`. The resulting slices share the sam
sam2/sam2_video_predictor.py:747
↓ 3 callersMethod_encode_memory_in_output
( self, current_vision_feats, feat_sizes, point_inputs, run_mem_encode
sam2/modeling/sam2_base.py:787
↓ 3 callersMethod_encode_new_memory
Encode the current image and its prediction into a memory feature.
sam2/modeling/sam2_base.py:676
↓ 3 callersMethod_get_image_feature
Compute the image features on a given frame.
efficient_track_anything/efficienttam_video_predictor.py:713
↓ 3 callersMethod_get_image_feature
Compute the image features on a given frame.
efficient_track_anything/efficienttam_video_predictor_npz.py:716
↓ 3 callersMethod_get_maskmem_pos_enc
`maskmem_pos_enc` is the same across frames and objects, so we cache it as a constant in the inference session to reduce session stor
sam2/sam2_video_predictor_npz.py:1020
↓ 3 callersMethod_get_maskmem_pos_enc
`maskmem_pos_enc` is the same across frames and objects, so we cache it as a constant in the inference session to reduce session stor
sam2/sam2_video_predictor.py:1016
↓ 3 callersMethod_get_trainer_state
(self, phase)
training/trainer.py:696
↓ 3 callersFunction_load_checkpoint
(model, ckpt_path)
sam2/build_sam.py:197
↓ 3 callersFunction_load_checkpoint
(model, ckpt_path)
efficient_track_anything/build_efficienttam.py:163
↓ 3 callersMethod_obj_id_to_idx
Map client-side object id to model-side object index.
sam2/sam2_video_predictor_npz.py:134
↓ 3 callersMethod_obj_id_to_idx
Map client-side object id to model-side object index.
sam2/sam2_video_predictor.py:130
↓ 3 callersMethod_obj_id_to_idx
Map client-side object id to model-side object index.
efficient_track_anything/efficienttam_video_predictor.py:127
↓ 3 callersMethod_obj_id_to_idx
Map client-side object id to model-side object index.
efficient_track_anything/efficienttam_video_predictor_npz.py:130
↓ 3 callersMethod_run_single_frame_inference
Run tracking on a single frame based on current inputs and previous memory.
sam2/sam2_video_predictor_npz.py:916
↓ 3 callersMethod_run_single_frame_inference
Run tracking on a single frame based on current inputs and previous memory.
sam2/sam2_video_predictor.py:912
↓ 3 callersMethod_run_single_frame_inference
Run tracking on a single frame based on current inputs and previous memory.
efficient_track_anything/efficienttam_video_predictor.py:746
↓ 3 callersMethod_run_single_frame_inference
Run tracking on a single frame based on current inputs and previous memory.
efficient_track_anything/efficienttam_video_predictor_npz.py:749
↓ 3 callersMethod_set_dataset_epoch
(self, dataset, epoch: int)
training/dataset/sam2_datasets.py:129
↓ 3 callersMethod_track_step
( self, frame_idx, is_init_cond_frame, current_vision_feats, current_v
sam2/modeling/sam2_base.py:726
↓ 3 callersMethod_use_multimask
Whether to use multimask output in the SAM head.
sam2/modeling/sam2_base.py:879
↓ 3 callersMethodadd_new_points_or_box
Add new points to a frame.
efficient_track_anything/efficienttam_video_predictor.py:170
↓ 3 callersFunctionapply_rotary_enc
( xq: torch.Tensor, xk: torch.Tensor, freqs_cis: torch.Tensor, repeat_freqs_k: bool = False, )
efficient_track_anything/modeling/position_encoding.py:212
↓ 3 callersFunctionbarrier
Wrapper over torch.distributed.barrier, returns without waiting if the distributed process group is not initialized instead of throwing error
training/utils/distributed.py:330
↓ 3 callersFunctionbuild_sam2_video_predictor_npz
( config_file, ckpt_path=None, device=None, mode="eval", hydra_overrides_extra=[], app
sam2/build_sam.py:135
↓ 3 callersMethodclose
Close writer, flushing pending logs to disk. Logs cannot be written after `close` is called.
training/utils/logger.py:97
↓ 3 callersFunctionfilter_params_matching_unix_pattern
Remove from the state dictionary the parameters matching the provided unix patterns Args: patterns: the list of unix patterns to exc
training/utils/checkpoint_utils.py:47
↓ 3 callersFunctionget_amp_type
(amp_type: Optional[str] = None)
training/utils/train_utils.py:138
↓ 3 callersFunctionget_best_available_device
Get the best available device in the order: CUDA, MPS, CPU Returns: device string for torch.device
sam2/build_sam.py:50
↓ 3 callersFunctionget_connected_components
Get the connected components (8-connectivity) of binary masks of shape (N, 1, H, W). Inputs: - mask: A binary mask tensor of shape (N, 1
sam2/utils/misc.py:47
next →1–100 of 862, ranked by callers