Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bowang-lab/MedSAM2
/ functions
Functions
862 in github.com/bowang-lab/MedSAM2
⨍
Functions
862
◇
Types & classes
142
Method
forward
(self, *args, **kwargs)
sam2/modeling/sam2_base.py:201
Method
forward
( self, tgt, memory, pos: Optional[Tensor] = None, query_pos: Optional
sam2/modeling/memory_attention.py:83
Method
forward
( self, curr: torch.Tensor, # self-attention inputs memory: torch.Tensor, # cross-at
sam2/modeling/memory_attention.py:119
Method
forward
(self, x)
sam2/modeling/efficienttam_utils.py:99
Method
forward
(self, x)
sam2/modeling/efficienttam_utils.py:131
Method
forward
(self, x: torch.Tensor)
sam2/modeling/efficienttam_utils.py:148
Method
forward
(self, x: torch.Tensor)
sam2/modeling/efficienttam_utils.py:337
Method
forward
(self, x)
sam2/modeling/memory_encoder.py:57
Method
forward
(self, x)
sam2/modeling/memory_encoder.py:104
Method
forward
(self, x)
sam2/modeling/memory_encoder.py:130
Method
forward
( self, pix_feat: torch.Tensor, masks: torch.Tensor, skip_mask_sigmoid: bool =
sam2/modeling/memory_encoder.py:158
Method
forward
(self, *args, **kwargs)
sam2/modeling/efficienttam_base.py:204
Method
forward
(self, x: torch.Tensor)
sam2/modeling/position_encoding.py:79
Method
forward
Generate positional encoding for a grid of the specified size.
sam2/modeling/position_encoding.py:138
Method
forward
(self, x)
sam2/modeling/backbones/vitdet.py:57
Method
forward
(self, x)
sam2/modeling/backbones/vitdet.py:147
Method
forward
(self, x: torch.Tensor)
sam2/modeling/backbones/vitdet.py:282
Method
forward
(self, x: torch.Tensor)
sam2/modeling/backbones/utils.py:90
Method
forward
(self, sample: torch.Tensor)
sam2/modeling/backbones/image_encoder.py:31
Method
forward
(self, xs: List[torch.Tensor])
sam2/modeling/backbones/image_encoder.py:104
Method
forward
(self, xs: List[torch.Tensor])
sam2/modeling/backbones/image_encoder.py:190
Method
forward
(self, x: torch.Tensor)
sam2/modeling/backbones/hieradet.py:56
Method
forward
(self, x: torch.Tensor)
sam2/modeling/backbones/hieradet.py:134
Method
forward
(self, x: torch.Tensor)
sam2/modeling/backbones/hieradet.py:283
Method
forward
Predict masks given image and prompt embeddings. Arguments: image_embeddings (torch.Tensor): the embeddings from the image
sam2/modeling/sam/mask_decoder.py:110
Method
forward
Args: image_embedding (torch.Tensor): image to attend to. Should be shape B x embedding_dim x h x w for any h and w.
sam2/modeling/sam/transformer.py:90
Method
forward
( self, queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor )
sam2/modeling/sam/transformer.py:181
Method
forward
(self, q: Tensor, k: Tensor, v: Tensor)
sam2/modeling/sam/transformer.py:255
Method
forward
( self, q: Tensor, k: Tensor, v: Tensor, num_k_exclude_rope: int = 0 )
sam2/modeling/sam/transformer.py:311
Method
forward
Embeds different types of prompts, returning both sparse and dense embeddings. Arguments: points (tuple(torch.Tens
sam2/modeling/sam/prompt_encoder.py:140
Method
forward
( self, tgt, memory, pos: Optional[Tensor] = None, query_pos: Optional
efficient_track_anything/modeling/memory_attention.py:94
Method
forward
( self, curr: torch.Tensor, # self-attention inputs memory: torch.Tensor, # cross-at
efficient_track_anything/modeling/memory_attention.py:130
Method
forward
(self, x)
efficient_track_anything/modeling/efficienttam_utils.py:99
Method
forward
(self, x)
efficient_track_anything/modeling/efficienttam_utils.py:131
Method
forward
(self, x: torch.Tensor)
efficient_track_anything/modeling/efficienttam_utils.py:148
Method
forward
(self, x: torch.Tensor)
efficient_track_anything/modeling/efficienttam_utils.py:337
Method
forward
(self, x)
efficient_track_anything/modeling/memory_encoder.py:61
Method
forward
(self, x)
efficient_track_anything/modeling/memory_encoder.py:108
Method
forward
(self, x)
efficient_track_anything/modeling/memory_encoder.py:134
Method
forward
( self, pix_feat: torch.Tensor, masks: torch.Tensor, skip_mask_sigmoid: bool =
efficient_track_anything/modeling/memory_encoder.py:162
Method
forward
(self, *args, **kwargs)
efficient_track_anything/modeling/efficienttam_base.py:204
Method
forward
(self, x: torch.Tensor)
efficient_track_anything/modeling/position_encoding.py:127
Method
forward
Generate positional encoding for a grid of the specified size.
efficient_track_anything/modeling/position_encoding.py:156
Method
forward
(self, x)
efficient_track_anything/modeling/backbones/vitdet.py:57
Method
forward
(self, x)
efficient_track_anything/modeling/backbones/vitdet.py:147
Method
forward
(self, x: torch.Tensor)
efficient_track_anything/modeling/backbones/vitdet.py:282
Method
forward
(self, x: torch.Tensor)
efficient_track_anything/modeling/backbones/utils.py:90
Method
forward
(self, sample: torch.Tensor)
efficient_track_anything/modeling/backbones/image_encoder.py:31
Method
forward
(self, xs: List[torch.Tensor])
efficient_track_anything/modeling/backbones/image_encoder.py:98
Method
forward
Predict masks given image and prompt embeddings. Arguments: image_embeddings (torch.Tensor): the embeddings from the image
efficient_track_anything/modeling/sam/mask_decoder.py:110
Method
forward
Args: image_embedding (torch.Tensor): image to attend to. Should be shape B x embedding_dim x h x w for any h and w.
efficient_track_anything/modeling/sam/transformer.py:68
Method
forward
( self, queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor )
efficient_track_anything/modeling/sam/transformer.py:159
Method
forward
(self, q: Tensor, k: Tensor, v: Tensor)
efficient_track_anything/modeling/sam/transformer.py:233
Method
forward
( self, q: Tensor, k: Tensor, v: Tensor, num_k_exclude_rope: int = 0 )
efficient_track_anything/modeling/sam/transformer.py:278
Method
forward
( self, q: Tensor, k: Tensor, v: Tensor, num_k_exclude_rope: int = 0 )
efficient_track_anything/modeling/sam/transformer.py:339
Method
forward
( self, q: Tensor, k: Tensor, v: Tensor, num_k_exclude_rope: int = 0 )
efficient_track_anything/modeling/sam/transformer.py:452
Method
forward
Embeds different types of prompts, returning both sparse and dense embeddings. Arguments: points (tuple(torch.Tens
efficient_track_anything/modeling/sam/prompt_encoder.py:160
Method
forward
(self, outs_batch: List[Dict], targets_batch: torch.Tensor)
training/loss_fns.py:167
Method
forward
(ctx, x)
training/utils/distributed.py:492
Method
forward
(self, input: BatchedVideoDatapoint)
training/model/efficienttam.py:131
Method
forward
(self, input: BatchedVideoDatapoint)
training/model/sam2.py:107
Method
forward_image
Get the image feature on the input batch.
sam2/modeling/efficienttam_base.py:469
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
sam2/sam2_image_predictor.py:71
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
sam2/sam2_video_predictor_npz.py:118
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
sam2/sam2_video_predictor.py:114
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
efficient_track_anything/efficienttam_video_predictor.py:109
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
efficient_track_anything/efficienttam_image_predictor.py:75
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
efficient_track_anything/automatic_mask_generator.py:154
Method
from_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
efficient_track_anything/efficienttam_video_predictor_npz.py:112
Function
gather_from_all
(tensor: torch.Tensor)
training/utils/distributed.py:312
Method
generate
Generates masks for the given image. Arguments: image (np.ndarray): The image to generate masks for, in HWC uint8 format.
efficient_track_anything/automatic_mask_generator.py:173
Function
generate_crop_boxes
Generates a list of crop boxes of different sizes. Each layer has (2**i)**2 boxes for the ith layer.
sam2/utils/amg.py:202
Function
get_activation_fn
Return an activation function given a string
sam2/modeling/efficienttam_utils.py:77
Function
get_clones
(module, N)
sam2/modeling/efficienttam_utils.py:88
Function
get_cuda_device_index
()
training/utils/distributed.py:379
Method
get_ext_filename
(self, ext_name)
setup.py:136
Method
get_image_embedding
Returns the image embeddings for the currently set image, with shape 1xCxHxW, where C is the embedding dimension and (H,W) are
sam2/sam2_image_predictor.py:442
Method
get_image_embedding
Returns the image embeddings for the currently set image, with shape 1xCxHxW, where C is the embedding dimension and (H,W) are
efficient_track_anything/efficienttam_image_predictor.py:446
Method
get_layer_id
(self, layer_name)
sam2/modeling/backbones/hieradet.py:301
Function
get_next_point
(gt_masks, pred_masks, method)
efficient_track_anything/modeling/efficienttam_utils.py:317
Function
get_primary_rank
()
training/utils/distributed.py:364
Function
get_sdpa_settings
()
efficient_track_anything/utils/misc.py:17
Method
get_valid_obj_frames_ids
(self, num_frames_min=None)
training/dataset/vos_segment_loader.py:82
Method
get_video
Given a VOSVideo object, return the mask tensors.
training/dataset/vos_raw_dataset.py:114
Method
get_video
Given a VOSVideo object, return the mask tensors.
training/dataset/vos_raw_dataset.py:189
Method
get_video
Given a VOSVideo object, return the mask tensors.
training/dataset/vos_raw_dataset.py:265
Method
get_video
Given a VOSVideo object, return the mask tensors.
training/dataset/vos_raw_dataset.py:344
Function
handle_drawing_board_get_input_first_frame
(session_id, input_first_frame)
app.py:578
Function
handle_extract_video_info
(session_id, input_video)
app.py:467
Function
handle_get_meta_from_video
(session_id, input_video, scale_slider, selected_config, selected_checkpoint)
app.py:503
Function
handle_increment_ann_obj_id
(session_id, max_obj_id)
app.py:558
Function
handle_reset
(session_id)
app.py:587
Function
handle_sam_click
(session_id, frame_num, point_mode, click_stack, ann_obj_id, evt: gr.SelectData)
app.py:546
Function
handle_sam_stroke
(session_id, drawing_board, last_draw, frame_num, ann_obj_id)
app.py:535
Function
handle_show_res_by_slider
(session_id, frame_per, slider_state, click_stack)
app.py:612
Function
handle_tracking_objects
(session_id, frame_num, input_video)
app.py:624
Function
handle_update_current_id
(session_id, ann_obj_id)
app.py:569
Function
infer_3d
(img_npz_file)
medsam2_infer_CT_lesion_npz_recist.py:281
Function
infer_3d
(mha_name)
examples/infer_CT_LUNA25.py:131
Function
init_distributed_data_parallel_model
( model: torch.nn.Module, broadcast_buffers: bool = False, find_unused_parameters: bool = True,
training/utils/distributed.py:383
← previous
next →
701–800 of 862, ranked by callers