MCPcopy Create free account

hub / github.com/PolyU-ChenLab/UniPixel / functions

Functions437 in github.com/PolyU-ChenLab/UniPixel

↓ 57 callersMethodcat
(self, new_stats: "MaskData")
sam2/utils/amg.py:59
↓ 49 callersMethoditems
(self)
sam2/utils/amg.py:41
↓ 16 callersMethodclear
(self)
unipixel/conversation.py:18
↓ 10 callersFunctionload_image
(path)
unipixel/utils/io.py:15
↓ 10 callersFunctionprocess_masks
(sample, frame_size, inds)
unipixel/dataset/utils.py:378
↓ 10 callersFunctionprocess_vision_info
( conversations: list[dict] | list[list[dict]], return_video_kwargs: bool = False, sanity_check=Fa
unipixel/dataset/utils.py:344
↓ 8 callersFunctionbuild_model
(model_path, config=None, image_size=None, is_trainable=False,
unipixel/model/builder.py:13
↓ 8 callersMethoddevice
(self)
sam2/modeling/sam2_base.py:197
↓ 8 callersMethodfilter
(self, keep: torch.Tensor)
sam2/utils/amg.py:44
↓ 8 callersMethodfrom_pretrained
Load a pretrained model from the Hugging Face hub. Arguments: model_id (str): The Hugging Face repository ID. **
sam2/sam2_image_predictor.py:70
↓ 8 callersMethodgenerate
Generates masks for the given image. Arguments: image (np.ndarray): The image to generate masks for, in HWC uint8 format.
sam2/automatic_mask_generator.py:156
↓ 8 callersMethodsave
Args: filepath (str): a string that contains the absolute path, including the file name, where the visualized ima
unipixel/utils/visualizer.py:223
↓ 7 callersFunctionget_sam2_transform
(size)
unipixel/utils/transforms.py:33
↓ 7 callersFunctionload_frames
(paths, sample_frames=-1, sample_type='uniform', sample_for_llm_only=False)
unipixel/utils/io.py:49
↓ 6 callersMethod_get_orig_video_res_output
Resize the object scores to the original video resolution (video_res_masks) and apply non-overlapping constraints for final output.
sam2/sam2_video_predictor.py:454
↓ 6 callersMethod_separate_heads
(self, x: Tensor, num_heads: int)
sam2/modeling/sam/transformer.py:209
↓ 6 callersMethodload_annos
(self, split='train')
unipixel/dataset/sub_classes/segmentation.py:262
↓ 5 callersMethod_consolidate_temp_output_across_obj
Consolidate the per-object temporary outputs in `temp_output_dict_per_obj` on a frame into a single output for all objects, including
sam2/sam2_video_predictor.py:476
↓ 5 callersMethod_prepare_backbone_features
Prepare and flatten visual features.
sam2/modeling/sam2_base.py:474
↓ 5 callersFunctionget_next_point
(gt_masks, pred_masks, method, positive_only=True)
sam2/modeling/sam2_utils.py:314
↓ 4 callersMethod_get_obj_num
Get the total number of unique object ids received so far in this session.
sam2/sam2_video_predictor.py:157
↓ 4 callersMethod_obj_id_to_idx
Map client-side object id to model-side object index.
sam2/sam2_video_predictor.py:127
↓ 4 callersMethod_predict
Predict masks for the given input prompts, using the currently set image. Input prompts are batched torch tensors and are expected to
sam2/sam2_image_predictor.py:312
↓ 4 callersMethod_run_single_frame_inference
Run tracking on a single frame based on current inputs and previous memory.
sam2/sam2_video_predictor.py:800
↓ 4 callersMethodarea
(self)
unipixel/utils/visualizer.py:164
↓ 4 callersFunctionceil_by_factor
Returns the smallest integer greater than or equal to 'number' that is divisible by 'factor'.
unipixel/dataset/utils.py:49
↓ 4 callersMethoddraw_polygon
Args: segment: numpy array of shape Nx2, containing all the points in the polygon. color: color of the polygon. Refer
unipixel/utils/visualizer.py:655
↓ 4 callersFunctionfloor_by_factor
Returns the largest integer less than or equal to 'number' that is divisible by 'factor'.
unipixel/dataset/utils.py:54
↓ 4 callersMethodforward_image
Get the image feature on the input batch.
sam2/modeling/sam2_base.py:464
↓ 4 callersFunctionload_frames_with_inds_keep
(path, all_frame_inds, frame_idx,
unipixel/utils/io.py:143
↓ 4 callersFunctionload_video
(path, sample_frames=-1)
unipixel/utils/io.py:21
↓ 4 callersFunctionrandom_color
(rgb=False, maximum=1)
unipixel/utils/visualizer.py:40
↓ 4 callersFunctionresize
(mask, size)
unipixel/dataset/utils.py:374
↓ 4 callersFunctionsample_box_points
Sample a noised version of the top left and bottom right corners of a given `bbox` Inputs: - masks: [B, 1, H,W] boxes, dtype=torch.Tenso
sam2/modeling/sam2_utils.py:153
↓ 4 callersFunctionsmart_resize
Rescales the image so that the following conditions are met: 1. Both dimensions (height and width) are divisible by 'factor'. 2. The to
unipixel/dataset/utils.py:59
↓ 4 callersFunctiontime_str_to_seconds
Converts a time string to seconds.
unipixel/eval/eval_groundmore.py:233
↓ 4 callersMethodtransform_coords
Expects a torch tensor with length 2 in the last dimension. The coordinates can be in absolute image or normalized coordinates, If th
sam2/utils/transforms.py:44
↓ 3 callersMethod__init__
(self, layer, num_layers, dim=None, input_projection=False)
sam2/modeling/memory_encoder.py:119
↓ 3 callersMethod__init__
( self, embedding_dim: int, num_heads: int, downsample_rate: int = 1,
sam2/modeling/sam/transformer.py:187
↓ 3 callersMethod_apply_non_overlapping_constraints
Apply non-overlapping constraints to the object scores in pred_masks. Here we keep only the highest scoring object at each spatial lo
sam2/modeling/sam2_base.py:868
↓ 3 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
unipixel/utils/visualizer.py:722
↓ 3 callersMethod_forward_sam_heads
Forward SAM prompt encoders and mask heads. Inputs: - backbone_features: image features of [B, C, H, W] shape - poin
sam2/modeling/sam2_base.py:253
↓ 3 callersMethod_get_image_feature
Compute the image features on a given frame.
sam2/sam2_video_predictor.py:754
↓ 3 callersMethoddraw_binary_mask_with_number
Args: binary_mask (ndarray): numpy array of shape (H, W), where H is the image height and W is the image width. E
unipixel/utils/visualizer.py:579
↓ 3 callersMethoddraw_text
Args: text (str): class label position (tuple): a tuple of the x and y coordinates to place text on image.
unipixel/utils/visualizer.py:303
↓ 3 callersMethodforward_with_coords
Positionally encode points that are not normalized to [0,1].
sam2/modeling/position_encoding.py:177
↓ 3 callersFunctionget_auto_device
()
unipixel/utils/env.py:6
↓ 3 callersFunctionget_connected_components
Get the connected components (8-connectivity) of binary masks of shape (N, 1, H, W). Inputs: - mask: A binary mask tensor of shape (N, 1
sam2/utils/misc.py:47
↓ 3 callersMethodget_dense_pe
Returns the positional encoding used to encode point prompts, applied to a dense set of points the shape of the image encoding.
sam2/modeling/sam/prompt_encoder.py:66
↓ 3 callersFunctionload_frames_with_inds
(path, keep, single_frame_mode=False,
unipixel/utils/io.py:79
↓ 3 callersMethodreset_predictor
Resets the image embeddings and other state variables.
sam2/sam2_image_predictor.py:421
↓ 3 callersFunctionround_by_factor
Returns the closest integer to 'number' that is divisible by 'factor'.
unipixel/dataset/utils.py:44
↓ 2 callersMethod__getitem__
(self, index)
sam2/utils/misc.py:147
↓ 2 callersMethod__init__
( self, input_dim: int, hidden_dim: int, output_dim: int, num_layers:
sam2/modeling/sam2_utils.py:111
↓ 2 callersMethod__init__
( self, num_pos_feats, temperature: int = 10000, normalize: bo
sam2/modeling/position_encoding.py:21
↓ 2 callersMethod__init__
( self, embed_dim: int = 96, # initial embed dim num_heads: int = 1, # i
sam2/modeling/backbones/hieradet.py:184
↓ 2 callersMethod__init__
(self, config)
unipixel/model/qwen2_5_vl.py:46
↓ 2 callersMethod_encode_memory_in_output
( self, current_vision_feats, feat_sizes, point_inputs, run_mem_encode
sam2/modeling/sam2_base.py:766
↓ 2 callersMethod_encode_xy
(self, x, y)
sam2/modeling/position_encoding.py:58
↓ 2 callersMethod_get_maskmem_pos_enc
`maskmem_pos_enc` is the same across frames and objects, so we cache it as a constant in the inference session to reduce session stor
sam2/sam2_video_predictor.py:912
↓ 2 callersFunction_hf_download
(model_id)
sam2/build_sam.py:141
↓ 2 callersFunction_load_checkpoint
(model, ckpt_path)
sam2/build_sam.py:159
↓ 2 callersFunction_load_img_as_tensor
(img_path, image_size)
sam2/utils/misc.py:92
↓ 2 callersMethod_pe
(self, B, device, dtype, *cache_key)
sam2/modeling/position_encoding.py:97
↓ 2 callersMethod_pe_encoding
Positionally encode points that are normalized to [0,1].
sam2/modeling/position_encoding.py:149
↓ 2 callersMethod_pe_encoding
Positionally encode points that are normalized to [0,1].
sam2/modeling/position_encoding.py:207
↓ 2 callersMethod_prep_prompts
(self, point_coords, point_labels, box, mask_logits, normalize_coords, img_idx=-1)
sam2/sam2_image_predictor.py:290
↓ 2 callersMethod_recombine_heads
(self, x: Tensor)
sam2/modeling/sam/transformer.py:214
↓ 2 callersFunction_seg2bmap
(seg, width=None, height=None)
unipixel/eval/eval_seg.py:123
↓ 2 callersFunction_seg2bmap
From a segmentation, compute a binary boundary map with 1 pixel wide boundaries. The boundary pixels are offset by 1/2 pixel towards the
unipixel/eval/eval_revos.py:193
↓ 2 callersFunction_seg2bmap
From a segmentation, compute a binary boundary map with 1 pixel wide boundaries. The boundary pixels are offset by 1/2 pixel towards the
unipixel/eval/eval_groundmore.py:175
↓ 2 callersMethod_track_step
( self, frame_idx, is_init_cond_frame, current_vision_feats, current_v
sam2/modeling/sam2_base.py:705
↓ 2 callersMethod_use_multimask
Whether to use multimask output in the SAM head.
sam2/modeling/sam2_base.py:860
↓ 2 callersMethodadd_new_hidden_state
( self, inference_state, frame_idx, obj_id, hidden, )
sam2/sam2_video_predictor.py:162
↓ 2 callersFunctionbatch_iterator
(batch_size: int, *args)
sam2/utils/amg.py:99
↓ 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..
sam2/utils/amg.py:285
↓ 2 callersFunctionbox_xyxy_to_xywh
(box_xyxy: torch.Tensor)
sam2/utils/amg.py:92
↓ 2 callersFunctionbuild_obj_to_frame_idx
(label_mask, batch_mode)
unipixel/dataset/utils.py:474
↓ 2 callersFunctionbuild_sam2_hf
(model_id, **kwargs)
sam2/build_sam.py:149
↓ 2 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
sam2/utils/amg.py:154
↓ 2 callersFunctionconcat_points
Add new points and labels to previous point inputs (add at the end).
sam2/utils/misc.py:332
↓ 2 callersFunctioncrop_len
(orig_len, n_crops, overlap)
sam2/utils/amg.py:201
↓ 2 callersFunctiondb_statistics
Compute mean,recall and decay from per-frame evaluation. Arguments: per_frame_values (ndarray): per-frame evaluation Returns:
unipixel/eval/eval_groundmore.py:21
↓ 2 callersFunctiondo_pool
(x: torch.Tensor, pool: nn.Module, norm: nn.Module = None)
sam2/modeling/backbones/hieradet.py:25
↓ 2 callersFunctiondraw_mask
(frames, masks, colors=None)
unipixel/utils/visualizer.py:776
↓ 2 callersFunctionf_measure
(foreground_mask, gt_mask, void_pixels=None, bound_th=0.008)
unipixel/eval/eval_seg.py:72
↓ 2 callersFunctionf_measure
Compute mean,recall and decay from per-frame evaluation. Calculates precision/recall for boundaries between foreground_mask and gt_mask u
unipixel/eval/eval_revos.py:129
↓ 2 callersFunctionf_measure
Compute mean,recall and decay from per-frame evaluation. Calculates precision/recall for boundaries between foreground_mask and gt_mask u
unipixel/eval/eval_groundmore.py:110
↓ 2 callersFunctionfetch_image
(ele: dict[str, str | Image.Image], size_factor: int = IMAGE_FACTOR)
unipixel/dataset/utils.py:99
↓ 2 callersFunctiongather
(param)
unipixel/train/custom_trainer.py:17
↓ 2 callersFunctiongather_non_lora_params
(model)
unipixel/train/custom_trainer.py:51
↓ 2 callersMethodgetImgIds
(self, ref_ids=[])
unipixel/dataset/sub_classes/utils.py:153
↓ 2 callersFunctioninit
()
unipixel/eval/videorefer_bench_d/1.eval_gpt_4o_mini.py:15
↓ 2 callersFunctioninit
()
unipixel/eval/videorefer_bench_d/1.eval_gpt_4o.py:15
↓ 2 callersMethodinit_state
Initialize an inference state.
sam2/sam2_video_predictor.py:45
↓ 2 callersMethodload_sam2_weights
(self)
unipixel/model/qwen2_5_vl.py:131
↓ 2 callersMethodmask_to_polygons
(self, mask)
unipixel/utils/visualizer.py:140
↓ 2 callersFunctionmask_to_rle_pytorch
Encodes masks to an uncompressed RLE, in the format expected by pycoco tools.
sam2/utils/amg.py:107
↓ 2 callersFunctionparse_question
(question)
unipixel/utils/parser.py:6
↓ 2 callersMethodpropagate_in_video
Propagate the input points across frames to track in the entire video.
sam2/sam2_video_predictor.py:611
next →1–100 of 437, ranked by callers