SYMBOL INDEX (131 symbols across 13 files) FILE: sam_lora.py class _LoRA_qkv (line 18) | class _LoRA_qkv(nn.Module): method __init__ (line 26) | def __init__( method forward (line 43) | def forward(self, x): class LoRA_Sam (line 51) | class LoRA_Sam(nn.Module): method __init__ (line 68) | def __init__(self, sam_model: Sam, r: int, lora_layer=None): method load_fc_parameters (line 111) | def load_fc_parameters(self, filename: str) -> None: method save_lora_parameters (line 128) | def save_lora_parameters(self, filename: str) -> None: method load_lora_parameters (line 149) | def load_lora_parameters(self, filename: str) -> None: method reset_parameters (line 179) | def reset_parameters(self) -> None: FILE: segment_anything/automatic_mask_generator.py class SamAutomaticMaskGenerator (line 35) | class SamAutomaticMaskGenerator: method __init__ (line 36) | def __init__( method generate (line 137) | def generate(self, image: np.ndarray) -> List[Dict[str, Any]]: method _generate_masks (line 197) | def _generate_masks(self, image: np.ndarray) -> MaskData: method _process_crop (line 225) | def _process_crop( method _process_batch (line 266) | def _process_batch( method postprocess_small_regions (line 324) | def postprocess_small_regions( FILE: segment_anything/build_sam.py function build_sam_vit_h (line 14) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 27) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 37) | def build_sam_vit_b(checkpoint=None): function _build_sam (line 55) | def _build_sam( FILE: segment_anything/modeling/common.py class MLPBlock (line 13) | class MLPBlock(nn.Module): method __init__ (line 14) | def __init__( method forward (line 25) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 31) | class LayerNorm2d(nn.Module): method __init__ (line 32) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 38) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: segment_anything/modeling/image_encoder.py class ImageEncoderViT (line 17) | class ImageEncoderViT(nn.Module): method __init__ (line 18) | def __init__( method forward (line 106) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 119) | class Block(nn.Module): method __init__ (line 122) | def __init__( method forward (line 166) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 185) | class Attention(nn.Module): method __init__ (line 188) | def __init__( method forward (line 224) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 243) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 267) | def window_unpartition( function get_rel_pos (line 292) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 325) | def add_decomposed_rel_pos( class PatchEmbed (line 364) | class PatchEmbed(nn.Module): method __init__ (line 369) | def __init__( method forward (line 391) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: segment_anything/modeling/mask_decoder.py class MaskDecoder (line 16) | class MaskDecoder(nn.Module): method __init__ (line 17) | def __init__( method forward (line 71) | def forward( method predict_masks (line 112) | def predict_masks( class MLP (line 154) | class MLP(nn.Module): method __init__ (line 155) | def __init__( method forward (line 171) | def forward(self, x): FILE: segment_anything/modeling/prompt_encoder.py class PromptEncoder (line 16) | class PromptEncoder(nn.Module): method __init__ (line 17) | def __init__( method get_dense_pe (line 62) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 73) | def _embed_points( method _embed_boxes (line 93) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 102) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 107) | def _get_batch_size( method _get_device (line 125) | def _get_device(self) -> torch.device: method forward (line 128) | def forward( class PositionEmbeddingRandom (line 171) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 176) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 185) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 194) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 207) | def forward_with_coords( FILE: segment_anything/modeling/sam.py class Sam (line 18) | class Sam(nn.Module): method __init__ (line 22) | def __init__( method device (line 50) | def device(self) -> Any: method forward (line 54) | def forward( method postprocess_masks (line 133) | def postprocess_masks( method preprocess (line 164) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: segment_anything/modeling/transformer.py class TwoWayTransformer (line 16) | class TwoWayTransformer(nn.Module): method __init__ (line 17) | def __init__( method forward (line 62) | def forward( class TwoWayAttentionBlock (line 109) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 110) | def __init__( method forward (line 151) | def forward( class Attention (line 185) | class Attention(nn.Module): method __init__ (line 191) | def __init__( method _separate_heads (line 208) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 213) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 218) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: segment_anything/predictor.py class SamPredictor (line 17) | class SamPredictor: method __init__ (line 18) | def __init__( method set_image (line 34) | def set_image( method set_torch_image (line 63) | def set_torch_image( method predict (line 92) | def predict( method predict_torch (line 169) | def predict_torch( method get_image_embedding (line 245) | def get_image_embedding(self) -> torch.Tensor: method device (line 259) | def device(self) -> torch.device: method reset_image (line 262) | def reset_image(self) -> None: FILE: segment_anything/utils/amg.py class MaskData (line 16) | class MaskData: method __init__ (line 22) | def __init__(self, **kwargs) -> None: method __setitem__ (line 29) | def __setitem__(self, key: str, item: Any) -> None: method __delitem__ (line 35) | def __delitem__(self, key: str) -> None: method __getitem__ (line 38) | def __getitem__(self, key: str) -> Any: method items (line 41) | def items(self) -> ItemsView[str, Any]: method filter (line 44) | def filter(self, keep: torch.Tensor) -> None: method cat (line 59) | def cat(self, new_stats: "MaskData") -> None: method to_numpy (line 72) | def to_numpy(self) -> None: function is_box_near_crop_edge (line 78) | def is_box_near_crop_edge( function box_xyxy_to_xywh (line 91) | def box_xyxy_to_xywh(box_xyxy: torch.Tensor) -> torch.Tensor: function batch_iterator (line 98) | def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None,... function mask_to_rle_pytorch (line 107) | def mask_to_rle_pytorch(tensor: torch.Tensor) -> List[Dict[str, Any]]: function rle_to_mask (line 138) | def rle_to_mask(rle: Dict[str, Any]) -> np.ndarray: function area_from_rle (line 152) | def area_from_rle(rle: Dict[str, Any]) -> int: function calculate_stability_score (line 156) | def calculate_stability_score( function build_point_grid (line 179) | def build_point_grid(n_per_side: int) -> np.ndarray: function build_all_layer_point_grids (line 189) | def build_all_layer_point_grids( function generate_crop_boxes (line 200) | def generate_crop_boxes( function uncrop_boxes_xyxy (line 237) | def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch... function uncrop_points (line 246) | def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Te... function uncrop_masks (line 255) | def uncrop_masks( function remove_small_regions (line 267) | def remove_small_regions( function coco_encode_rle (line 294) | def coco_encode_rle(uncompressed_rle: Dict[str, Any]) -> Dict[str, Any]: function batched_mask_to_box (line 303) | def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: FILE: segment_anything/utils/onnx.py class SamOnnxModel (line 17) | class SamOnnxModel(nn.Module): method __init__ (line 25) | def __init__( method resize_longest_image_size (line 42) | def resize_longest_image_size( method _embed_points (line 51) | def _embed_points(self, point_coords: torch.Tensor, point_labels: torc... method _embed_masks (line 69) | def _embed_masks(self, input_mask: torch.Tensor, has_mask_input: torch... method mask_postprocessing (line 76) | def mask_postprocessing(self, masks: torch.Tensor, orig_im_size: torch... method select_masks (line 92) | def select_masks( method forward (line 108) | def forward( FILE: segment_anything/utils/transforms.py class ResizeLongestSide (line 16) | class ResizeLongestSide: method __init__ (line 23) | def __init__(self, target_length: int) -> None: method apply_image (line 26) | def apply_image(self, image: np.ndarray) -> np.ndarray: method apply_coords (line 33) | def apply_coords(self, coords: np.ndarray, original_size: Tuple[int, .... method apply_boxes (line 47) | def apply_boxes(self, boxes: np.ndarray, original_size: Tuple[int, ...... method apply_image_torch (line 55) | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: method apply_coords_torch (line 67) | def apply_coords_torch( method apply_boxes_torch (line 83) | def apply_boxes_torch( method get_preprocess_shape (line 94) | def get_preprocess_shape(oldh: int, oldw: int, long_side_length: int) ...