MCPcopy Create free account

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

Functions862 in github.com/bowang-lab/MedSAM2

↓ 2 callersFunctionsave_palette_masks_to_dir
Save masks to a directory as PNG files.
medsam2_infer_video.py:83
↓ 2 callersFunctionsdp_kernel_context
Get the context for the attention scaled dot-product kernel. We use Flash Attention by default, but fall back to all available kernels if Fla
sam2/modeling/sam/transformer.py:28
↓ 2 callersMethodsetup_job_info
Set up slurm job info
training/train.py:102
↓ 2 callersFunctionshow_box
show bounding box on the image Parameters ---------- box : numpy.ndarray bounding box coordinates in the original image
eff_medsam2_infer_CT_lesion_npz_recist.py:176
↓ 2 callersFunctionshow_mask
show mask on the image Parameters ---------- mask : numpy.ndarray mask of the image ax : matplotlib.axes.Axes ax
eff_medsam2_infer_CT_lesion_npz_recist.py:152
↓ 2 callersFunctionsigmoid_focal_loss
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002. Args: inputs: A float tensor of arbitrary shape.
training/loss_fns.py:52
↓ 2 callersMethodtrack_step
( self, frame_idx, is_init_cond_frame, current_vision_feats, current_v
efficient_track_anything/modeling/efficienttam_base.py:816
↓ 2 callersMethodtransform_boxes
Expects a tensor of shape Bx4. The coordinates can be in absolute image or normalized coordinates, if the coords are in absolute imag
sam2/utils/transforms.py:66
↓ 2 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
sam2/utils/transforms.py:46
↓ 2 callersFunctionuncrop_boxes_xyxy
(boxes: torch.Tensor, crop_box: List[int])
efficient_track_anything/utils/amg.py:239
↓ 2 callersFunctionvflip
(datapoint, index)
training/dataset/transforms.py:140
↓ 2 callersFunctionwindow_partition
Partition into non-overlapping windows with padding if needed. Args: x (tensor): input tokens with [B, H, W, C]. window_size
sam2/modeling/backbones/utils.py:17
↓ 2 callersFunctionwindow_unpartition
Window unpartition into original sequences and removing padding. Args: x (tensor): input tokens with [B * num_windows, window_size, w
sam2/modeling/backbones/utils.py:40
↓ 1 callersMethod__init__
( self, d_model: int, pos_enc_at_input: bool, layer: nn.Module, num_la
sam2/modeling/memory_attention.py:103
↓ 1 callersMethod__init__
( self, num_pos_feats, temperature: int = 10000, normalize: bool = True,
sam2/modeling/position_encoding.py:22
↓ 1 callersMethod__init__
( self, fill_hole_area=0, # whether to apply non-overlapping constraints on the output
efficient_track_anything/efficienttam_video_predictor.py:29
↓ 1 callersMethod__init__
( self, fill_hole_area=0, # whether to apply non-overlapping constraints on the output
efficient_track_anything/efficienttam_video_predictor_npz.py:29
↓ 1 callersMethod__init__
( self, d_model: int, pos_enc_at_input: bool, layer: nn.Module, num_la
efficient_track_anything/modeling/memory_attention.py:114
↓ 1 callersMethod__init__
( self, num_pos_feats, temperature: int = 10000, normalize: bool = True,
efficient_track_anything/modeling/position_encoding.py:22
↓ 1 callersMethod__init__
Initialize the neck :param trunk: the backbone :param position_encoding: the positional encoding to use :param d_model: the d
efficient_track_anything/modeling/backbones/image_encoder.py:48
↓ 1 callersMethod__init__
(self, sort_frames=True)
training/dataset/vos_sampler.py:23
↓ 1 callersMethod__init__
(self, dataset, indices)
training/dataset/utils.py:34
↓ 1 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/efficienttam_base.py:893
↓ 1 callersMethod_build_sam_heads
Build SAM-style prompt encoder and mask decoder.
sam2/modeling/sam2_base.py:207
↓ 1 callersMethod_build_sam_heads
Build SAM-style prompt encoder and mask decoder.
sam2/modeling/efficienttam_base.py:209
↓ 1 callersMethod_build_sam_heads
Build SAM-style prompt encoder and mask decoder.
efficient_track_anything/modeling/efficienttam_base.py:209
↓ 1 callersFunction_cached_log_stream
(filename)
training/utils/logger.py:181
↓ 1 callersMethod_check_val_key_match
(self, val_keys, phase)
training/trainer.py:961
↓ 1 callersMethod_compile_all_components
(self)
efficient_track_anything/efficienttam_video_predictor.py:992
↓ 1 callersMethod_compile_all_components
(self)
efficient_track_anything/efficienttam_video_predictor_npz.py:995
↓ 1 callersMethod_construct_optimizers
(self)
training/trainer.py:1032
↓ 1 callersMethod_dynamic_multimask_via_stability
When outputting a single mask, if the stability score from the current single-mask output (based on output token 0) falls below a thr
sam2/modeling/sam/mask_decoder.py:259
↓ 1 callersMethod_dynamic_multimask_via_stability
When outputting a single mask, if the stability score from the current single-mask output (based on output token 0) falls below a thr
efficient_track_anything/modeling/sam/mask_decoder.py:259
↓ 1 callersMethod_embed_bbox
Embed bounding boxes.
sam2/sam2_video_trainer.py:293
↓ 1 callersMethod_embed_boxes
Embeds box prompts.
sam2/modeling/sam/prompt_encoder.py:103
↓ 1 callersMethod_embed_boxes
Embeds box prompts.
efficient_track_anything/modeling/sam/prompt_encoder.py:123
↓ 1 callersMethod_embed_masks
Embeds mask inputs.
sam2/modeling/sam/prompt_encoder.py:114
↓ 1 callersMethod_embed_masks
Embeds mask inputs.
efficient_track_anything/modeling/sam/prompt_encoder.py:134
↓ 1 callersMethod_embed_points
Embeds point prompts.
sam2/modeling/sam/prompt_encoder.py:79
↓ 1 callersMethod_embed_points
Embeds point prompts.
efficient_track_anything/modeling/sam/prompt_encoder.py:79
↓ 1 callersMethod_encode_memory_in_output
( self, current_vision_feats, feat_sizes, point_inputs, run_mem_encode
sam2/modeling/efficienttam_base.py:791
↓ 1 callersMethod_encode_memory_in_output
( self, current_vision_feats, feat_sizes, point_inputs, run_mem_encode
efficient_track_anything/modeling/efficienttam_base.py:791
↓ 1 callersMethod_encode_new_memory
Encode the current image and its prediction into a memory feature.
sam2/modeling/efficienttam_base.py:680
↓ 1 callersMethod_encode_new_memory
Identical to the corresponding method in the parent (EfficientTAMVideoPredictor), but cloning the memories and their pos enc to enabl
efficient_track_anything/efficienttam_video_predictor.py:1171
↓ 1 callersMethod_encode_new_memory
Identical to the corresponding method in the parent (EfficientTAMVideoPredictor), but cloning the memories and their pos enc to enabl
efficient_track_anything/efficienttam_video_predictor_npz.py:1174
↓ 1 callersMethod_encode_new_memory
Encode the current image and its prediction into a memory feature.
efficient_track_anything/modeling/efficienttam_base.py:680
↓ 1 callersMethod_forward
Compute the losses related to the masks: the focal loss and the dice loss. and also the MAE or MSE loss between predicted IoUs and ac
training/loss_fns.py:184
↓ 1 callersMethod_forward_ca
(self, tgt, memory, query_pos, pos, num_k_exclude_rope=0)
sam2/modeling/memory_attention.py:66
↓ 1 callersMethod_forward_ca
(self, tgt, memory, query_pos, pos, num_k_exclude_rope=0)
efficient_track_anything/modeling/memory_attention.py:73
↓ 1 callersMethod_forward_sa
(self, tgt, query_pos)
sam2/modeling/memory_attention.py:58
↓ 1 callersMethod_forward_sa
(self, tgt, query_pos)
efficient_track_anything/modeling/memory_attention.py:65
↓ 1 callersMethod_generate_masks
(self, image: np.ndarray)
efficient_track_anything/automatic_mask_generator.py:227
↓ 1 callersMethod_get_batch_fmtstr
(self, num_batches)
training/utils/train_utils.py:275
↓ 1 callersMethod_get_batch_size
Gets the batch size of the output given the batch size of the input prompts.
sam2/modeling/sam/prompt_encoder.py:119
↓ 1 callersMethod_get_batch_size
Gets the batch size of the output given the batch size of the input prompts.
efficient_track_anything/modeling/sam/prompt_encoder.py:139
↓ 1 callersMethod_get_datapoint
(self, idx)
training/dataset/vos_dataset.py:51
↓ 1 callersMethod_get_device
(self)
sam2/modeling/sam/prompt_encoder.py:137
↓ 1 callersMethod_get_device
(self)
efficient_track_anything/modeling/sam/prompt_encoder.py:157
↓ 1 callersMethod_get_empty_mask_ptr
Get a dummy object pointer based on an empty mask on the current frame.
sam2/sam2_video_predictor_npz.py:560
↓ 1 callersMethod_get_empty_mask_ptr
Get a dummy object pointer based on an empty mask on the current frame.
sam2/sam2_video_predictor.py:556
↓ 1 callersMethod_get_epoch_indices
Create a list of dataset indices (with repeats) to use for one epoch. Args: generator (torch.Generator): pseudo random n
training/dataset/utils.py:58
↓ 1 callersMethod_get_points_placeholder
Generates a placeholder for point coordinates and labels. Args: batch_size (int, optional): The size of the batch. If no
sam2/sam2_video_trainer.py:222
↓ 1 callersMethod_get_pos_embed
(self, hw: Tuple[int, int])
sam2/modeling/backbones/hieradet.py:273
↓ 1 callersMethod_get_stability_scores
Compute stability scores of the mask logits based on the IoU between upper and lower thresholds.
sam2/modeling/sam/mask_decoder.py:247
↓ 1 callersMethod_get_stability_scores
Compute stability scores of the mask logits based on the IoU between upper and lower thresholds.
efficient_track_anything/modeling/sam/mask_decoder.py:247
↓ 1 callersMethod_infer_distributed_backend_if_none
(self, distributed_conf, accelerator)
training/trainer.py:253
↓ 1 callersMethod_init_model_state
(self)
training/trainer.py:391
↓ 1 callersMethod_initialize_memory
Initialize memory for the first frame.
sam2/sam2_video_trainer.py:373
↓ 1 callersMethod_iter_correct_pt_sampling
( self, is_init_cond_frame, point_inputs, gt_masks, high_res_features,
training/model/efficienttam.py:472
↓ 1 callersMethod_iter_correct_pt_sampling
( self, is_init_cond_frame, point_inputs, gt_masks, high_res_features,
training/model/sam2.py:448
↓ 1 callersMethod_load_multiple_pngs
load multiple png masks from the disk (path: f'{obj_id}/{frame_id:05d}.png') Args: frame_id: int, define the mask path
training/dataset/vos_segment_loader.py:200
↓ 1 callersMethod_load_resuming_checkpoint
(self, ckpt_path: str)
training/trainer.py:422
↓ 1 callersMethod_load_single_png
load single png from the disk (path: f'{self.obj_id}/{frame_id:05d}.png') Args: frame_id: int, define the mask path
training/dataset/vos_segment_loader.py:181
↓ 1 callersMethod_log_loss_detailed_and_return_core_loss
(self, loss, loss_str, step)
training/trainer.py:1040
↓ 1 callersMethod_log_sync_data_times
(self, phase, data_times)
training/trainer.py:839
↓ 1 callersMethod_move_to_device
(self)
training/trainer.py:313
↓ 1 callersMethod_obj_idx_to_id
Map model-side object index to client-side object id.
efficient_track_anything/efficienttam_video_predictor.py:161
↓ 1 callersMethod_obj_idx_to_id
Map model-side object index to client-side object id.
efficient_track_anything/efficienttam_video_predictor_npz.py:164
↓ 1 callersMethod_predict_first_frame
Predict masks and IoUs for the first frame.
sam2/sam2_video_trainer.py:307
↓ 1 callersMethod_predict_frame
Predict masks and IoUs for subsequent frames using memory.
sam2/sam2_video_trainer.py:446
↓ 1 callersMethod_prepare_backbone_features_per_frame
Compute the image backbone features on the fly for the given img_ids.
training/model/efficienttam.py:143
↓ 1 callersMethod_prepare_backbone_features_per_frame
Compute the image backbone features on the fly for the given img_ids.
training/model/sam2.py:119
↓ 1 callersMethod_prepare_memory
Prepare memory for the current frame.
sam2/sam2_video_trainer.py:402
↓ 1 callersMethod_prepare_memory_conditioned_features
Fuse the current frame's visual feature map with previous memory.
sam2/modeling/sam2_base.py:497
↓ 1 callersMethod_prepare_memory_conditioned_features
Fuse the current frame's visual feature map with previous memory.
sam2/modeling/efficienttam_base.py:499
↓ 1 callersMethod_prepare_memory_conditioned_features
Fuse the current frame's visual feature map with previous memory.
efficient_track_anything/modeling/efficienttam_base.py:499
↓ 1 callersMethod_process_batch
( self, points: np.ndarray, im_size: Tuple[int, ...], crop_box: List[int],
efficient_track_anything/automatic_mask_generator.py:297
↓ 1 callersMethod_process_crop
( self, image: np.ndarray, crop_box: List[int], crop_layer_idx: int, o
efficient_track_anything/automatic_mask_generator.py:254
↓ 1 callersMethod_reset_tracking_results
Reset all tracking inputs and results across the videos.
efficient_track_anything/efficienttam_video_predictor.py:698
↓ 1 callersMethod_reset_tracking_results
Reset all tracking inputs and results across the videos.
efficient_track_anything/efficienttam_video_predictor_npz.py:701
↓ 1 callersMethod_run_memory_encoder
Run the memory encoder on `high_res_masks`. This is usually after applying non-overlapping constraints to object scores. Since their
sam2/sam2_video_predictor_npz.py:984
↓ 1 callersMethod_run_memory_encoder
Run the memory encoder on `high_res_masks`. This is usually after applying non-overlapping constraints to object scores. Since their
sam2/sam2_video_predictor.py:980
↓ 1 callersMethod_run_memory_encoder
Run the memory encoder on `high_res_masks`. This is usually after applying non-overlapping constraints to object scores. Since their
efficient_track_anything/efficienttam_video_predictor.py:814
↓ 1 callersMethod_run_memory_encoder
Run the memory encoder on `high_res_masks`. This is usually after applying non-overlapping constraints to object scores. Since their
efficient_track_anything/efficienttam_video_predictor_npz.py:817
↓ 1 callersMethod_run_step
Run the forward / backward
training/trainer.py:850
↓ 1 callersMethod_save_checkpoint
Save a checkpoint while guarding against the job being killed in the middle of checkpoint saving (which corrupts the checkpoint file
training/trainer.py:363
↓ 1 callersMethod_setup_components
(self)
training/trainer.py:986
↓ 1 callersMethod_setup_dataloaders
(self)
training/trainer.py:517
↓ 1 callersMethod_setup_ddp_distributed_training
(self, distributed_conf, accelerator)
training/trainer.py:291
↓ 1 callersMethod_setup_device
(self, accelerator)
training/trainer.py:281
← previousnext →201–300 of 862, ranked by callers