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
__init__
(self, prob=0.15, grid_h=2, grid_w=2, use_random_hflip=False)
training/dataset/transforms.py:529
Method
__init__
Args: consistent_transform (bool): Whether to use the same noise parameters for all frames in the video mean (float):
training/dataset/transforms.py:562
Method
__init__
Args: consistent_transform (bool): Whether to use the same blur parameters for all frames kernel_size (int): Gaussian
training/dataset/transforms.py:602
Method
__init__
Args: dataloaders (List[DataLoader]): List of DataLoaders to be mixed. mixing_prob (torch.FloatTensor): Probability o
training/dataset/sam2_datasets.py:19
Method
__init__
Args: datasets (List[Dataset]): List of Datasets to be mixed. batch_sizes (List[int]): Batch sizes for each dataset i
training/dataset/sam2_datasets.py:71
Method
__init__
(self, datasets: Iterable[Dataset])
training/dataset/utils.py:20
Method
__init__
(self, dataset, seed: int = 0)
training/dataset/utils.py:49
Method
__init__
(self)
training/dataset/vos_raw_dataset.py:51
Method
__init__
( self, img_folder, gt_folder, file_list_txt=None, excluded_videos_lis
training/dataset/vos_raw_dataset.py:59
Method
__init__
( self, folder, file_list_txt=None, excluded_videos_list_txt=None, sam
training/dataset/vos_raw_dataset.py:150
Method
__init__
( self, img_folder, gt_folder, file_list_txt=None, excluded_videos_lis
training/dataset/vos_raw_dataset.py:227
Method
__init__
( self, img_folder, gt_folder, file_list_txt=None, excluded_videos_lis
training/dataset/vos_raw_dataset.py:298
Method
__init__
(self, video_json_path, ann_every=1, frames_fps=24, valid_obj_ids=None)
training/dataset/vos_segment_loader.py:24
Method
__init__
SegmentLoader for datasets with masks stored as palettised PNGs. video_png_root: the folder contains all the masks stored in png
training/dataset/vos_segment_loader.py:104
Method
__init__
video_png_root: the folder contains all the masks stored in png single_object_mode: whether to load only a single object at a time
training/dataset/vos_segment_loader.py:153
Method
__init__
(self)
training/dataset/vos_segment_loader.py:237
Method
__init__
( self, video_mask_path, mask_area_frac_thresh=1.1, video_frame_path=None,
training/dataset/vos_segment_loader.py:263
Method
__init__
Initialize the NPZSegmentLoader. Args: masks (numpy.ndarray): Array of masks with shape (img_num, H, W).
training/dataset/vos_segment_loader.py:305
Method
__init__
( self, transforms, training: bool, video_dataset: VOSRawDataset, samp
training/dataset/vos_dataset.py:28
Method
__init__
( self, image_encoder, memory_attention=None, memory_encoder=None, pro
training/model/efficienttam.py:27
Method
__init__
( self, image_encoder, memory_attention=None, memory_encoder=None, pro
training/model/sam2.py:26
Method
__iter__
(self)
training/dataset/sam2_datasets.py:37
Method
__len__
(self)
sam2/utils/misc.py:168
Method
__len__
(self)
efficient_track_anything/utils/misc.py:168
Method
__len__
(self)
training/dataset/sam2_datasets.py:34
Method
__len__
(self)
training/dataset/utils.py:81
Method
__len__
(self)
training/dataset/vos_raw_dataset.py:46
Method
__len__
(self)
training/dataset/vos_raw_dataset.py:146
Method
__len__
(self)
training/dataset/vos_raw_dataset.py:223
Method
__len__
(self)
training/dataset/vos_raw_dataset.py:289
Method
__len__
(self)
training/dataset/vos_raw_dataset.py:385
Method
__len__
(self)
training/dataset/vos_segment_loader.py:148
Method
__len__
(self)
training/dataset/vos_segment_loader.py:228
Method
__len__
(self)
training/dataset/vos_segment_loader.py:255
Method
__len__
(self)
training/dataset/vos_dataset.py:134
Method
__next__
Sample a dataloader to sample from based on mixing probabilities. If one of the dataloaders is exhausted, we continue sampling from the other
training/dataset/sam2_datasets.py:44
Method
__post_init__
(self)
training/trainer.py:81
Method
__repr__
(self)
training/dataset/transforms.py:250
Method
__setitem__
(self, key: str, item: Any)
sam2/utils/amg.py:31
Method
__setitem__
(self, key: str, item: Any)
efficient_track_anything/utils/amg.py:31
Method
__setitem__
(self, key, item)
training/dataset/vos_segment_loader.py:241
Method
__str__
(self)
training/utils/train_utils.py:180
Method
__str__
(self)
training/utils/train_utils.py:211
Method
__str__
(self)
training/utils/train_utils.py:248
Method
_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
efficient_track_anything/efficienttam_video_predictor.py:965
Method
_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
efficient_track_anything/efficienttam_video_predictor_npz.py:968
Method
_forward_sam_heads
Identical to the corresponding method in the parent (EfficientTAMVideoPredictor), but cloning the outputs of prompt_encoder and mask_
efficient_track_anything/efficienttam_video_predictor.py:1036
Method
_forward_sam_heads
Identical to the corresponding method in the parent (EfficientTAMVideoPredictor), but cloning the outputs of prompt_encoder and mask_
efficient_track_anything/efficienttam_video_predictor_npz.py:1039
Method
_load_frames
()
sam2/utils/misc.py:137
Method
_load_frames
()
efficient_track_anything/utils/misc.py:137
Method
_map_keys
(container)
sam2/sam2_video_predictor_npz.py:1101
Method
_map_keys
(container)
sam2/sam2_video_predictor.py:1097
Method
_map_keys
(container)
efficient_track_anything/efficienttam_video_predictor.py:929
Method
_map_keys
(container)
efficient_track_anything/efficienttam_video_predictor_npz.py:932
Method
_obj_idx_to_id
Map model-side object index to client-side object id.
sam2/sam2_video_predictor_npz.py:168
Method
_obj_idx_to_id
Map model-side object index to client-side object id.
sam2/sam2_video_predictor.py:164
Method
_prepare_backbone_features
Prepare and flatten visual features.
sam2/modeling/efficienttam_base.py:483
Method
_slice_state
(output_dict, storage_key)
sam2/sam2_video_predictor_npz.py:1115
Method
_slice_state
(output_dict, storage_key)
sam2/sam2_video_predictor.py:1111
Method
add_new_mask
Add new mask to a frame.
sam2/sam2_video_predictor_npz.py:325
Method
add_new_mask
Add new mask to a frame.
efficient_track_anything/efficienttam_video_predictor_npz.py:312
Method
add_new_points
Deprecated method. Please use `add_new_points_or_box` instead.
sam2/sam2_video_predictor_npz.py:320
Method
add_new_points
Deprecated method. Please use `add_new_points_or_box` instead.
efficient_track_anything/efficienttam_video_predictor.py:304
Method
add_new_points
Deprecated method. Please use `add_new_points_or_box` instead.
efficient_track_anything/efficienttam_video_predictor_npz.py:307
Function
all_gather
Run all_gather on arbitrary picklable data (not necessarily tensors) Args: data: any picklable object Returns: list[data]
training/utils/distributed.py:114
Function
all_gather_batch
Performs all_gather operation on the provided tensors.
training/utils/distributed.py:465
Function
all_gather_batch_with_grad
Performs all_gather operation on the provided tensors. Graph remains connected for backward grad computation.
training/utils/distributed.py:504
Function
all_reduce_mean
Wrapper over torch.distributed.all_reduce for performing mean reduction of tensor over all processes.
training/utils/distributed.py:228
Function
all_reduce_min
Wrapper over torch.distributed.all_reduce for performing min reduction of tensor over all processes in both distributed / non-distributed
training/utils/distributed.py:249
Function
all_reduce_sum
Wrapper over torch.distributed.all_reduce for performing sum reduction of tensor over all processes in both distributed / non-distributed
training/utils/distributed.py:240
Function
area_from_rle
(rle: Dict[str, Any])
sam2/utils/amg.py:154
Function
batch_iterator
(batch_size: int, *args)
sam2/utils/amg.py:100
Function
batched_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..
sam2/utils/amg.py:305
Function
box_xyxy_to_xywh
(box_xyxy: torch.Tensor)
sam2/utils/amg.py:93
Function
broadcast_object
Broadcast an object from a source to all workers. Args: obj: Object to broadcast, must be serializable src: Source rank for broad
training/utils/distributed.py:411
Function
build_all_layer_point_grids
Generates point grids for all crop layers.
sam2/utils/amg.py:191
Method
build_extensions
(self)
setup.py:129
Function
calculate_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
sam2/utils/amg.py:158
Function
coco_encode_rle
(uncompressed_rle: Dict[str, Any])
sam2/utils/amg.py:296
Function
collate_fn
Args: batch: A list of VideoDatapoint instances. dict_key (str): A string key used to identify the batch.
training/utils/data_utils.py:114
Function
compute_axial_cis
(dim: int, end_x: int, end_y: int, theta: float = 10000.0)
sam2/modeling/position_encoding.py:174
Function
compute_axial_cis
(dim: int, end_x: int, end_y: int, theta: float = 10000.0)
efficient_track_anything/modeling/position_encoding.py:192
Function
create_new_process_group
Creates process groups of a gives `group_size` and returns process group that current GPU participates in. `group_size` must divide the
training/utils/distributed.py:532
Method
device
(self)
sam2/sam2_image_predictor.py:458
Method
device
(self)
sam2/modeling/efficienttam_base.py:201
Method
device
(self)
efficient_track_anything/efficienttam_image_predictor.py:462
Function
dice_multi_class
(preds, targets)
medsam2_infer_3D_CT.py:81
Method
encode_boxes
(self, x, y, w, h)
sam2/modeling/position_encoding.py:62
Method
encode_boxes
(self, x, y, w, h)
efficient_track_anything/modeling/position_encoding.py:73
Method
encode_points
(self, x, y, labels)
sam2/modeling/position_encoding.py:70
Method
encode_points
(self, x, y, labels)
efficient_track_anything/modeling/position_encoding.py:81
Function
extract_session_id_from_request
(request: gr.Request)
app.py:456
Method
finalize_options
(self)
setup.py:122
Method
flat_img_batch
Returns a flattened img_batch_tensor of shape [(B*T)xCxHxW]
training/utils/data_utils.py:82
Method
flat_obj_to_img_idx
Returns a flattened tensor containing the object to img index. The flat index can be used to access a flattened img_batch of shape [(
training/utils/data_utils.py:72
Method
flush
Writes pending logs to disk.
training/utils/logger.py:89
Method
forward
Forward pass for processing video frames and predicting masks, logits, and IoUs. Args: videos (torch.Tensor): A tensor o
sam2/sam2_video_trainer.py:133
Method
forward
(self, x)
sam2/modeling/sam2_utils.py:99
Method
forward
(self, x)
sam2/modeling/sam2_utils.py:131
Method
forward
(self, x: torch.Tensor)
sam2/modeling/sam2_utils.py:148
← previous
next →
601–700 of 862, ranked by callers