MCPcopy Create free account

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

Functions862 in github.com/bowang-lab/MedSAM2

↓ 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
efficient_track_anything/utils/misc.py:47
↓ 3 callersFunctionget_human_readable_count
Abbreviates an integer number with K, M, B, T for thousands, millions, billions and trillions, respectively. Examples: >>> get_hu
training/trainer.py:1087
↓ 3 callersMethodinit_state
Initialize an inference state.
efficient_track_anything/efficienttam_video_predictor.py:49
↓ 3 callersFunctionis_distributed_training_run
()
training/utils/distributed.py:212
↓ 3 callersFunctionis_main_process
Return true if the current process is the main one
training/utils/distributed.py:50
↓ 3 callersMethodpropagate_in_video
Propagate the input points across frames to track in the entire video.
efficient_track_anything/efficienttam_video_predictor.py:555
↓ 3 callersFunctionregister_omegaconf_resolvers
()
training/utils/train_utils.py:52
↓ 3 callersMethodreset_predictor
Resets the image embeddings and other state variables.
efficient_track_anything/efficienttam_image_predictor.py:465
↓ 3 callersMethodreset_state
Remove all input points or mask in all frames throughout the video.
efficient_track_anything/efficienttam_video_predictor.py:685
↓ 3 callersMethodset_epoch
(self, epoch: int)
training/dataset/utils.py:25
↓ 3 callersMethodstep_schedulers
(self, where: float, step: int)
training/optimizer.py:52
↓ 2 callersMethod__getitem__
(self, index)
sam2/utils/misc.py:147
↓ 2 callersMethod__getitem__
(self, index)
efficient_track_anything/utils/misc.py:147
↓ 2 callersMethod__init__
( self, input_dim: int, hidden_dim: int, output_dim: int, num_layers:
sam2/modeling/sam2_utils.py:113
↓ 2 callersMethod__init__
Args: img_size (int): Input image size. Only relevant for rel pos. patch_size (int): Patch size. in_chans
sam2/modeling/backbones/vitdet.py:173
↓ 2 callersMethod__init__
Initialize the neck :param trunk: the backbone :param position_encoding: the positional encoding to use :param d_model: the di
sam2/modeling/backbones/image_encoder.py:54
↓ 2 callersMethod__init__
( self, embed_dim: int = 96, # initial embed dim num_heads: int = 1, # initial numbe
sam2/modeling/backbones/hieradet.py:174
↓ 2 callersMethod__init__
Args: img_size (int): Input image size. Only relevant for rel pos. patch_size (int): Patch size. in_chans
efficient_track_anything/modeling/backbones/vitdet.py:173
↓ 2 callersMethod_call_model_initializer
(self)
training/trainer.py:412
↓ 2 callersMethod_clear_non_cond_mem_around_input
Remove the non-conditioning memory around the input frame. When users provide correction clicks, the surrounding frames' non-conditio
sam2/sam2_video_predictor_npz.py:1159
↓ 2 callersMethod_clear_non_cond_mem_around_input
Remove the non-conditioning memory around the input frame. When users provide correction clicks, the surrounding frames' non-conditio
sam2/sam2_video_predictor.py:1155
↓ 2 callersMethod_encode_xy
(self, x, y)
sam2/modeling/position_encoding.py:42
↓ 2 callersMethod_encode_xy
(self, x, y)
efficient_track_anything/modeling/position_encoding.py:53
↓ 2 callersMethod_extract_memory_features
Extracts memory features from the given features and masks. Args: features (dict): A dictionary containing feature maps
sam2/sam2_video_trainer.py:343
↓ 2 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/efficienttam_base.py:259
↓ 2 callersMethod_forward_sam_heads
Forward SAM prompt encoders and mask heads. Inputs: - backbone_features: image features of [B, C, H, W] shape - poin
efficient_track_anything/modeling/efficienttam_base.py:259
↓ 2 callersFunction_get_global_gloo_group
Return a process group based on gloo backend, containing all the ranks The result is cached.
training/utils/distributed.py:31
↓ 2 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
efficient_track_anything/efficienttam_video_predictor.py:850
↓ 2 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
efficient_track_anything/efficienttam_video_predictor_npz.py:853
↓ 2 callersFunction_get_state_dict_summary
(state_dict: Dict[str, torch.Tensor])
training/utils/checkpoint_utils.py:89
↓ 2 callersFunction_hf_download
(model_id)
sam2/build_sam.py:177
↓ 2 callersFunction_hf_download
(model_id)
efficient_track_anything/build_efficienttam.py:143
↓ 2 callersFunction_load_img_as_tensor
(img_path, image_size)
sam2/utils/misc.py:92
↓ 2 callersFunction_load_img_as_tensor
(img_path, image_size)
efficient_track_anything/utils/misc.py:92
↓ 2 callersMethod_log_meters_and_save_best_ckpts
(self, phases: List[str])
training/trainer.py:896
↓ 2 callersMethod_log_timers
(self, phase)
training/trainer.py:928
↓ 2 callersMethod_pe
(self, B, device, *cache_key)
efficient_track_anything/modeling/position_encoding.py:90
↓ 2 callersMethod_pe_encoding
Positionally encode points that are normalized to [0,1].
sam2/modeling/position_encoding.py:129
↓ 2 callersMethod_pe_encoding
Positionally encode points that are normalized to [0,1].
efficient_track_anything/modeling/position_encoding.py:147
↓ 2 callersMethod_postprocess_masks
Perform post-processing on output masks.
sam2/sam2_video_trainer.py:331
↓ 2 callersMethod_predict
Predict masks for the given input prompts, using the currently set image. Input prompts are batched torch tensors and are expected to
sam2/sam2_image_predictor.py:339
↓ 2 callersMethod_prep_prompts
( self, point_coords, point_labels, box, mask_logits, normalize_coords, img_idx=-1 )
sam2/sam2_image_predictor.py:307
↓ 2 callersMethod_prep_prompts
( self, point_coords, point_labels, box, mask_logits, normalize_coords, img_idx=-1 )
efficient_track_anything/efficienttam_image_predictor.py:311
↓ 2 callersMethod_recombine_heads
(self, x: Tensor)
sam2/modeling/sam/transformer.py:250
↓ 2 callersMethod_reset_meters
(self, phases: str)
training/trainer.py:957
↓ 2 callersMethod_reset_tracking_results
Reset all tracking inputs and results across the videos.
sam2/sam2_video_predictor_npz.py:864
↓ 2 callersMethod_reset_tracking_results
Reset all tracking inputs and results across the videos.
sam2/sam2_video_predictor.py:860
↓ 2 callersMethod_step
( self, batch: BatchedVideoDatapoint, model: nn.Module, phase: str, )
training/trainer.py:450
↓ 2 callersMethodadd
(self, val)
training/utils/train_utils.py:245
↓ 2 callersMethodadd_new_mask
Add new mask to a frame.
efficient_track_anything/efficienttam_video_predictor.py:309
↓ 2 callersFunctionadd_pythonpath_to_sys_path
()
training/train.py:114
↓ 2 callersFunctionall_gather_via_filesys
Run all_gather on arbitrary picklable data (not necessarily tensors), similar to `all_gather` above, but using filesystem instead of collecti
training/utils/distributed.py:55
↓ 2 callersFunctionbatch_iterator
(batch_size: int, *args)
efficient_track_anything/utils/amg.py:100
↓ 2 callersFunctionbatched_mask_to_box
Calculates boxes in XYXY format around masks. Return [0,0,0,0] for an empty mask. For input shape C1xC2x...xHxW, the output shape is C1xC2x..
efficient_track_anything/utils/amg.py:305
↓ 2 callersFunctionbox_xyxy_to_xywh
(box_xyxy: torch.Tensor)
efficient_track_anything/utils/amg.py:93
↓ 2 callersFunctionbuild_efficienttam_hf
(model_id, **kwargs)
efficient_track_anything/build_efficienttam.py:151
↓ 2 callersFunctionbuild_efficienttam_video_predictor
( config_file, ckpt_path=None, device="cuda", mode="eval", hydra_overrides_extra=[], a
efficient_track_anything/build_efficienttam.py:93
↓ 2 callersFunctionbuild_efficienttam_video_predictor_hf
(model_id, **kwargs)
efficient_track_anything/build_efficienttam.py:156
↓ 2 callersFunctionbuild_sam2
( config_file, ckpt_path=None, device=None, mode="eval", hydra_overrides_extra=[], app
sam2/build_sam.py:63
↓ 2 callersFunctionbuild_sam2_video_predictor_hf
(model_id, **kwargs)
sam2/build_sam.py:190
↓ 2 callersFunctioncalculate_stability_score
Computes the stability score for a batch of masks. The stability score is the IoU between the binary masks obtained by thresholding the p
efficient_track_anything/utils/amg.py:158
↓ 2 callersFunctionconcat_points
Add new points and labels to previous point inputs (add at the end).
efficient_track_anything/utils/misc.py:339
↓ 2 callersFunctioncrop_len
(orig_len, n_crops, overlap)
sam2/utils/amg.py:217
↓ 2 callersFunctioncrop_len
(orig_len, n_crops, overlap)
efficient_track_anything/utils/amg.py:217
↓ 2 callersMethoddisplay
(self, batch, enable_print=False)
training/utils/train_utils.py:259
↓ 2 callersFunctiondo_pool
(x: torch.Tensor, pool: nn.Module, norm: nn.Module = None)
sam2/modeling/backbones/hieradet.py:25
↓ 2 callersFunctiondraw_markers
(image, points_dict, labels_dict)
app.py:188
↓ 2 callersFunctionfill_holes_in_mask_scores
A post processor to fill small holes in mask scores with area under `max_area`.
sam2/utils/misc.py:312
↓ 2 callersFunctionfill_holes_in_mask_scores
A post processor to fill small holes in mask scores with area under `max_area`.
efficient_track_anything/utils/misc.py:312
↓ 2 callersMethodfilter
(self, keep: torch.Tensor)
sam2/utils/amg.py:46
↓ 2 callersMethodforward_image
Get the image feature on the input batch.
efficient_track_anything/modeling/efficienttam_base.py:469
↓ 2 callersMethodforward_with_coords
Positionally encode points that are not normalized to [0,1].
sam2/modeling/position_encoding.py:151
↓ 2 callersMethodforward_with_coords
Positionally encode points that are not normalized to [0,1].
efficient_track_anything/modeling/position_encoding.py:169
↓ 2 callersFunctionget_1d_sine_pe
Get 1D sine positional embedding as in the original Transformer paper.
sam2/modeling/sam2_utils.py:64
↓ 2 callersFunctionget_clones
(module, N)
sam2/modeling/sam2_utils.py:88
↓ 2 callersFunctionget_clones
(module, N)
efficient_track_anything/modeling/efficienttam_utils.py:88
↓ 2 callersFunctionget_diameter_bbox
(recist_per_lab, shift=0)
medsam2_infer_CT_lesion_npz_recist.py:124
↓ 2 callersFunctionget_diameter_bbox
(recist_per_lab, shift=0)
eff_medsam2_infer_CT_lesion_npz_recist.py:282
↓ 2 callersMethodget_loader
(self, epoch)
training/dataset/sam2_datasets.py:135
↓ 2 callersFunctionget_machine_local_and_dist_rank
Get the distributed and local rank of the current gpu.
training/utils/train_utils.py:81
↓ 2 callersFunctionget_next_point
(gt_masks, pred_masks, method)
sam2/modeling/sam2_utils.py:317
↓ 2 callersFunctionget_next_point
(gt_masks, pred_masks, method)
sam2/modeling/efficienttam_utils.py:317
↓ 2 callersMethodget_num_layers
(self)
sam2/modeling/backbones/vitdet.py:301
↓ 2 callersFunctionhflip
(datapoint, index)
training/dataset/transforms.py:27
↓ 2 callersFunctionhuman_readable_time
(time_seconds)
training/utils/train_utils.py:224
↓ 2 callersMethodis_intermediate_val_epoch
(self, epoch)
training/trainer.py:447
↓ 2 callersFunctionload_ann_png
Load a PNG file as a mask and its palette.
medsam2_infer_video.py:20
↓ 2 callersFunctionload_masks_from_dir
Load masks from a directory as a dict of per-object masks.
medsam2_infer_video.py:56
↓ 2 callersMethodlog_dict
(self, payload: Dict[str, Scalar], step: int)
training/utils/logger.py:163
↓ 2 callersFunctionmask_to_box
compute bounding box given an input mask Inputs: - masks: [B, 1, H, W] masks, dtype=torch.Tensor Returns: - box_coords: [B, 1,
sam2/utils/misc.py:66
↓ 2 callersFunctionmask_to_rle_pytorch
Encodes masks to an uncompressed RLE, in the format expected by pycoco tools.
efficient_track_anything/utils/amg.py:109
↓ 2 callersFunctionput_per_obj_mask
Combine per-object masks into a single mask.
medsam2_infer_video.py:45
↓ 2 callersFunctionremove_small_regions
Removes small disconnected regions and holes in a mask. Returns the mask and an indicator of if the mask has been modified.
efficient_track_anything/utils/amg.py:269
↓ 2 callersMethodreset
(self)
training/utils/train_utils.py:194
↓ 2 callersMethodreset_predictor
Resets the image embeddings and other state variables.
sam2/sam2_image_predictor.py:461
↓ 2 callersFunctionresize
(datapoint, index, size, max_size=None, square=False, v2=False)
training/dataset/transforms.py:58
↓ 2 callersFunctionrle_to_mask
Compute a binary mask from an uncompressed RLE.
efficient_track_anything/utils/amg.py:140
↓ 2 callersMethodrun_train
(self)
training/trainer.py:527
↓ 2 callersFunctionsave_ann_png
Save a mask as a PNG file with the given palette.
medsam2_infer_video.py:28
↓ 2 callersMethodsave_checkpoint
(self, epoch, checkpoint_names=None)
training/trainer.py:324
← previousnext →101–200 of 862, ranked by callers