MCPcopy Create free account

hub / github.com/LiuTingWed/SAM-Not-Perfect / functions

Functions134 in github.com/LiuTingWed/SAM-Not-Perfect

Method__init__
A transformer block with four layers: (1) self-attention of sparse inputs, (2) cross attention of sparse inputs to dense inputs, (3)
segment_anything/modeling/transformer.py:110
Method__init__
SAM predicts object masks from an image and input prompts. Arguments: image_encoder (ImageEncoderViT): The backbone used t
segment_anything/modeling/sam.py:22
Method__init__
(self, num_pos_feats: int = 64, scale: Optional[float] = None)
segment_anything/modeling/prompt_encoder.py:176
Method__init__
(self, target_length: int)
segment_anything/utils/transforms.py:23
Method__init__
( self, model: Sam, return_single_mask: bool, use_stability_score: bool = Fals
segment_anything/utils/onnx.py:25
Method__init__
(self, **kwargs)
segment_anything/utils/amg.py:22
Method__setitem__
(self, key: str, item: Any)
segment_anything/utils/amg.py:29
Methodapply_boxes_torch
Expects a torch tensor with shape Bx4. Requires the original image size in (H, W) format.
segment_anything/utils/transforms.py:83
Methodapply_image_torch
Expects batched images with shape BxCxHxW and float format. This transformation may not exactly match apply_image. apply_image is
segment_anything/utils/transforms.py:55
Functionbuild_sam_vit_b
(checkpoint=None)
segment_anything/build_sam.py:37
Functionbuild_sam_vit_h
(checkpoint=None)
segment_anything/build_sam.py:14
Functionbuild_sam_vit_l
(checkpoint=None)
segment_anything/build_sam.py:27
Functioncal_iou
(gt, pred)
scripts/sam_f1_dice_mae.py:94
Functioncal_iou
(gt, pred)
scripts/sam_dice_f1_mae.py:94
Methoddevice
(self)
segment_anything/predictor.py:259
Methoddevice
(self)
segment_anything/modeling/sam.py:50
Methodforward
Predict masks given image and prompt embeddings. Arguments: image_embeddings (torch.Tensor): the embeddings from the image
segment_anything/modeling/mask_decoder.py:71
Methodforward
(self, x)
segment_anything/modeling/mask_decoder.py:171
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/image_encoder.py:106
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/image_encoder.py:166
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/image_encoder.py:224
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/image_encoder.py:391
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/common.py:25
Methodforward
(self, x: torch.Tensor)
segment_anything/modeling/common.py:38
Methodforward
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.
segment_anything/modeling/transformer.py:62
Methodforward
( self, queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor )
segment_anything/modeling/transformer.py:151
Methodforward
(self, q: Tensor, k: Tensor, v: Tensor)
segment_anything/modeling/transformer.py:218
Methodforward
Predicts masks end-to-end from provided images and prompts. If prompts are not known in advance, using SamPredictor is recomm
segment_anything/modeling/sam.py:54
Methodforward
Embeds different types of prompts, returning both sparse and dense embeddings. Arguments: points (tuple(torch.Tens
segment_anything/modeling/prompt_encoder.py:128
Methodforward
Generate positional encoding for a grid of the specified size.
segment_anything/modeling/prompt_encoder.py:194
Methodforward
( self, image_embeddings: torch.Tensor, point_coords: torch.Tensor, point_labe
segment_anything/utils/onnx.py:108
Methodget_image_embedding
Returns the image embeddings for the currently set image, with shape 1xCxHxW, where C is the embedding dimension and (H,W) are
segment_anything/predictor.py:245
Methodpredict
Predict masks for the given input prompts, using the currently set image. Arguments: point_coords (np.ndarray or None): A
segment_anything/predictor.py:92
Functionresize_image
(img, new_shape)
scripts/other_methods_dice_mae.py:29
← previous101–134 of 134, ranked by callers