MCPcopy Create free account

hub / github.com/UX-Decoder/Semantic-SAM / functions

Functions759 in github.com/UX-Decoder/Semantic-SAM

↓ 78 callersMethoditems
(self)
utils/sam_utils/amg.py:41
↓ 73 callersMethodcat
(self, new_stats: "MaskData")
utils/sam_utils/amg.py:59
↓ 71 callersMethodto
(self, device)
semantic_sam/utils/misc.py:47
↓ 32 callersMethodupdate
(self, val, n=1, decay=0)
utils/misc.py:55
↓ 17 callersMethodupdate
(self)
datasets/utils/tsv/io_common.py:29
↓ 13 callersFunctionbuild_detection_train_loader
Build a dataloader for object detection with some default features. This interface is experimental. Args: dataset (list or torch
datasets/build.py:284
↓ 11 callersFunctionpoint_sample
A wrapper around :function:`torch.nn.functional.grid_sample` to support 3D point_coords tensors. Unlike :function:`torch.nn.functional.grid_s
semantic_sam/modules/point_features.py:21
↓ 7 callersMethod__init__
( self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0 )
semantic_sam/backbone/swin_new.py:24
↓ 7 callersMethod__init__
( self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0 )
semantic_sam/backbone/swin.py:29
↓ 7 callersMethod_get_src_permutation_idx
(self, indices)
semantic_sam/modules/criterion_interactive_many_to_one.py:404
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
semantic_sam/backbone/focal_dw.py:27
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
semantic_sam/backbone/focal.py:27
↓ 6 callersMethod_get_src_permutation_idx
(self, indices)
semantic_sam/modules/criterion_interactive_many_to_many.py:397
↓ 6 callersMethodfilter
(self, keep: torch.Tensor)
utils/sam_utils/amg.py:44
↓ 6 callersMethodfrom_pretrained
(self, load_dir)
semantic_sam/BaseModel.py:25
↓ 6 callersMethodwith_pos_embed
(self, tensor, pos: Optional[Tensor])
semantic_sam/body/transformer_blocks.py:259
↓ 5 callersMethod_change_color_brightness
Depending on the brightness_factor, gives a lighter or darker color i.e. a color with less or more saturation than the original color
utils/visualizer.py:1193
↓ 5 callersMethodget_loss
(self, loss, outputs, targets, indices, num_masks=None, layer_id=None, extra=None)
semantic_sam/modules/criterion_interactive_many_to_many.py:409
↓ 5 callersFunctioninverse_sigmoid
(x, eps=1e-5)
semantic_sam/body/decoder/utils/utils.py:26
↓ 5 callersMethodsave
Args: filepath (str): a string that contains the absolute path, including the file name, where the visualized ima
utils/visualizer.py:302
↓ 5 callersMethodseek
(self, idx)
datasets/utils/tsv/tsv_io.py:38
↓ 4 callersMethod__init__
( self, d_model=512, nhead=8, num_encoder_layers=6, num_decoder_layers
semantic_sam/body/transformer_blocks.py:20
↓ 4 callersFunction_get_activation_fn
Return an activation function given a string
semantic_sam/body/decoder/modules.py:175
↓ 4 callersFunctionbox_cxcywh_to_xyxy
(x)
semantic_sam/utils/box_ops.py:9
↓ 4 callersFunctionbuild_model
(config, **kwargs)
semantic_sam/architectures/build.py:4
↓ 4 callersMethoddraw_binary_mask
Args: binary_mask (ndarray): numpy array of shape (H, W), where H is the image height and W is the image width. E
utils/visualizer.py:1047
↓ 4 callersMethoddraw_line
Args: x_data (list[int]): a list containing x values of all the points being drawn. Length of list should match t
utils/visualizer.py:1016
↓ 4 callersMethodevaluate_demo
(self, batched_inputs,all_whole=None,all_part=None,mask_features=None,multi_scale_features=None,return_feature
semantic_sam/architectures/interactive_mask_dino.py:288
↓ 4 callersMethodget_preprocess_shape
Compute the output size given input size and target long side length.
utils/sam_utils/transforms.py:94
↓ 4 callersFunctionload_config_dict_to_opt
Load the key, value pairs from config_dict to opt, overriding existing values in opt if there is any.
utils/arguments.py:9
↓ 4 callersFunctionmaybe_add_full_model_gradient_clipping
(optim)
datasets/build.py:646
↓ 4 callersMethodwith_pos_embed
(self, tensor, pos: Optional[Tensor])
semantic_sam/body/decoder/modules.py:90
↓ 3 callersMethod__init__
NOTE: this interface is experimental. Args: input_shape: shapes (channels and stride) of the input features t
semantic_sam/body/encoder/encoder_deform.py:183
↓ 3 callersMethod__init__
(self, input_dim, hidden_dim, output_dim, num_layers)
semantic_sam/body/decoder/modules.py:189
↓ 3 callersFunction_create_text_labels
Args: classes (list[int] or None): scores (list[float] or None): class_names (list[str] or None): is_crowd (list[
utils/visualizer.py:230
↓ 3 callersMethod_jitter
Randomly modifies given color to produce a slightly different color than the color given. Args: color (tuple[double]): a
utils/visualizer.py:1162
↓ 3 callersFunctioncalculate_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
utils/sam_utils/amg.py:156
↓ 3 callersMethoddevice
(self)
semantic_sam/architectures/interactive_mask_dino.py:285
↓ 3 callersMethoddraw_text
Args: text (str): class label position (tuple): a tuple of the x and y coordinates to place text on image.
utils/visualizer.py:862
↓ 3 callersMethodevaluate
(self)
datasets/evaluation/interactive_evaluation.py:136
↓ 3 callersMethodforward_features
:param features: multi-scale features from the backbone :param masks: image mask :return: enhanced multi-scale features and m
semantic_sam/body/encoder/encoder_deform.py:356
↓ 3 callersFunctionget_iou
(gt_masks, pred_masks, ignore_label=-1)
semantic_sam/utils/misc.py:25
↓ 3 callersFunctionget_prompt_templates
()
utils/prompt_engineering.py:4
↓ 3 callersFunctionload_opt_from_config_file
Load opt from the config files, settings in later files can override those in previous files. Args: conf_files: config file path
utils/arguments.py:29
↓ 3 callersFunctionms_deform_attn_core_pytorch
(value, value_spatial_shapes, sampling_locations, attention_weights)
semantic_sam/body/encoder/ops/functions/ms_deform_attn_func.py:52
↓ 3 callersMethodnum_rows
(self)
datasets/utils/tsv/tsv_io.py:35
↓ 3 callersMethodoverlay_instances
Args: boxes (Boxes, RotatedBoxes or ndarray): either a :class:`Boxes`, or an Nx4 numpy array of XYXY_ABS format f
utils/visualizer.py:619
↓ 3 callersMethodprocess
(self, inputs, outputs)
datasets/evaluation/interactive_evaluation.py:99
↓ 3 callersMethodread_json
(self, row)
datasets/dataset_mappers/sam_baseline_dataset_mapper.py:183
↓ 3 callersMethodreset
(self)
datasets/evaluation/interactive_evaluation.py:94
↓ 3 callersMethodreset_image
Args: img: same as in __init__
utils/visualizer.py:294
↓ 3 callersFunctionsigmoid_focal_loss
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002. Args: inputs: A float tensor of arbitrary shape.
semantic_sam/modules/criterion_interactive_many_to_many.py:25
↓ 2 callersMethod__init__
Construct a layernorm module in the TF style (epsilon inside the square root).
semantic_sam/language/LangEncoder/transformer.py:22
↓ 2 callersMethod__init__
NOTE: this interface is experimental. Args: input_shape: shapes (channels and stride) of the input features c
semantic_sam/body/encoder/transformer_encoder_fpn.py:23
↓ 2 callersFunction_called_with_cfg
Returns: bool: whether the arguments contain CfgNode and should be considered forwarded to from_config.
semantic_sam/utils/config.py:95
↓ 2 callersMethod_create_grayscale_image
Create a grayscale version of the original image. The colors in masked area, if given, will be kept.
utils/visualizer.py:1182
↓ 2 callersMethod_draw_text_in_mask
Find proper places to draw text given a binary mask.
utils/visualizer.py:1250
↓ 2 callersMethod_ensure_lineidx_loaded
(self)
datasets/utils/tsv/tsv_io.py:63
↓ 2 callersMethod_freeze_stages
(self)
semantic_sam/backbone/focal_dw.py:535
↓ 2 callersMethod_freeze_stages
(self)
semantic_sam/backbone/swin_new.py:618
↓ 2 callersMethod_freeze_stages
(self)
semantic_sam/backbone/focal.py:438
↓ 2 callersMethod_freeze_stages
(self)
semantic_sam/backbone/swin.py:629
↓ 2 callersFunction_get_activation_fn
Return an activation function given a string
semantic_sam/body/transformer_blocks.py:362
↓ 2 callersFunction_get_args_from_config
Use `from_config` to obtain explicit arguments. Returns: dict: arguments to be used for cls.__init__
semantic_sam/utils/config.py:112
↓ 2 callersFunction_get_clones
(module, N)
semantic_sam/body/transformer_blocks.py:358
↓ 2 callersFunction_get_clones
(module, N, layer_share=False)
semantic_sam/body/decoder/utils/utils.py:118
↓ 2 callersMethod_get_tgt_permutation_idx
(self, indices)
semantic_sam/modules/criterion_interactive_many_to_one.py:410
↓ 2 callersFunction_max_by_axis
(the_list)
semantic_sam/utils/misc.py:34
↓ 2 callersFunction_onnx_nested_tensor_from_tensor_list
(tensor_list: List[Tensor])
semantic_sam/utils/misc.py:140
↓ 2 callersFunction_print_panoptic_results
(pq_res)
datasets/evaluation/panoptic_evaluation.py:168
↓ 2 callersMethodarea
(self)
utils/visualizer.py:143
↓ 2 callersFunctionbatched_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..
utils/sam_utils/amg.py:303
↓ 2 callersFunctionbox_iou
(boxes1, boxes2)
semantic_sam/utils/box_ops.py:29
↓ 2 callersFunctionbox_xyxy_to_xywh
(box_xyxy: torch.Tensor)
utils/sam_utils/amg.py:91
↓ 2 callersFunctionbuild_detection_test_loader
Similar to `build_detection_train_loader`, with default batch size = 1, and sampler = :class:`InferenceSampler`. This sampler coordinates all
datasets/build.py:188
↓ 2 callersFunctionbuild_evaluator
Create evaluator(s) for a given dataset. This uses the special metadata "evaluator_type" associated with each builtin dataset. For your o
datasets/build.py:476
↓ 2 callersFunctionbuild_lang_encoder
(config_encoder, tokenizer, verbose, **kwargs)
semantic_sam/language/LangEncoder/build.py:10
↓ 2 callersMethodbuild_model
Returns: torch.nn.Module: It now calls :func:`detectron2.modeling.build_model`. Overwrite it if you'd like a dif
train_net.py:143
↓ 2 callersFunctionbuild_tokenizer
(config_encoder)
semantic_sam/language/LangEncoder/build.py:19
↓ 2 callersMethodcompute_similarity
(self, v_emb, name='default')
semantic_sam/language/encoder.py:123
↓ 2 callersFunctioncreate_long_image
(masks)
semantic_sam/build_semantic_sam.py:84
↓ 2 callersFunctioncrop_len
(orig_len, n_crops, overlap)
utils/sam_utils/amg.py:215
↓ 2 callersMethoddecompose
(self)
semantic_sam/utils/misc.py:58
↓ 2 callersMethoddraw_polygon
Args: segment: numpy array of shape Nx2, containing all the points in the polygon. color: color of the polygon. Refer
utils/visualizer.py:1126
↓ 2 callersFunctionfilter_empty_instances_by_box
( instances, by_box=True, by_mask=False, box_threshold=1e-5, return_mask=False )
datasets/dataset_mappers/dataset_mapper_filterbybox.py:13
↓ 2 callersMethodforward_language
(self, texts, norm=True)
semantic_sam/language/vlpencoder.py:142
↓ 2 callersMethodforward_language
(self, texts, norm=True)
semantic_sam/language/encoder.py:109
↓ 2 callersFunctiongeneralized_box_iou
Generalized IoU from https://giou.stanford.edu/ The boxes should be in [x0, y0, x1, y1] format Returns a [N, M] pairwise matrix, where
semantic_sam/utils/box_ops.py:45
↓ 2 callersFunctionget_config_from_name
(cfg, dataset_name)
datasets/build.py:331
↓ 2 callersFunctionget_detection_dataset_dicts
Load and prepare dataset dicts for instance detection/segmentation and semantic segmentation. Args: dataset_names (str or list[str])
datasets/build.py:115
↓ 2 callersMethodget_image
Returns: ndarray: the visualized image of shape (H, W, 3) (RGB) in uint8 type. The shape is scale
utils/visualizer.py:310
↓ 2 callersMethodget_loss
(self, loss, outputs, targets, indices, num_masks)
semantic_sam/modules/criterion_interactive_many_to_one.py:416
↓ 2 callersFunctionget_uncertain_point_coords_with_randomness
Sample points in [0, 1] x [0, 1] coordinate space based on their uncertainty. The unceratinties are calculated for each point using 'unce
semantic_sam/modules/point_features.py:65
↓ 2 callersFunctionimg_from_base64
(imagestring)
datasets/utils/tsv/io_common.py:33
↓ 2 callersFunctionis_dist_avail_and_initialized
()
semantic_sam/utils/misc.py:169
↓ 2 callersMethodmask_to_polygons
(self, mask)
utils/visualizer.py:119
↓ 2 callersFunctionmask_to_rle_pytorch
Encodes masks to an uncompressed RLE, in the format expected by pycoco tools.
utils/sam_utils/amg.py:107
↓ 2 callersFunctionmulti_head_attention_forward
r""" Args: query, key, value: map a query and a set of key-value pairs to an output. See "Attention Is All You Need" for more
semantic_sam/modules/attention.py:13
↓ 2 callersFunctionnested_tensor_from_tensor_list
(tensor_list: List[Tensor])
semantic_sam/utils/misc.py:64
↓ 2 callersMethodprepare_targets_interactive
prepare targets for interactive segmentation, mainly includes: box: mask: labels: part / instance
semantic_sam/architectures/interactive_mask_dino.py:430
next →1–100 of 759, ranked by callers