MCPcopy Create free account

hub / github.com/cvlab-kaist/VideoMaMa / functions

Functions168 in github.com/cvlab-kaist/VideoMaMa

↓ 6 callersFunctionget_files_from_folder
Helper function to get sorted image files from a directory.
data_pipeline/generate_synthetic.py:17
↓ 5 callersFunctionget_files_from_folder
Helper function to get sorted image files from a directory.
dataloader/synthetic_on_the_fly.py:28
↓ 4 callersFunction_filter2d
(input, kernel)
train.py:177
↓ 4 callersFunction_gaussian
(window_size: int, sigma)
train.py:202
↓ 4 callersFunctionaugment_by_resizing
Downsamples and upsamples the mask to remove fine details.
dataloader/augmentations.py:197
↓ 4 callersMethodl1_loss
(self, input, target, weight=None)
src/matting_loss.py:77
↓ 4 callersFunctionpoint_painter
Paint points on image Args: input_image: np.ndarray, (H, W, 3) input_points: np.ndarray, (N, 2), [x, y] coordinates
demo/tools/painter.py:76
↓ 4 callersMethodsobel
Using Sobel to compute gradient. Return the magnitude.
src/matting_loss.py:175
↓ 4 callersFunctionto_3_channel
(img_tensor)
train.py:1545
↓ 3 callersMethod__init__
Loads all necessary models into memory. Args: base_model_path (str): Path to the base Stable Video Diffusion model.
pipeline_svd_mask.py:846
↓ 3 callersMethod_encode_video_vae
( self, video_frames: torch.Tensor, # Expects (B, F, C, H, W) device: Uni
pipeline_svd_mask.py:230
↓ 3 callersFunction_resize_with_antialiasing
(input, size, interpolation="bicubic", align_corners=True)
train.py:124
↓ 3 callersFunctionapply_all_augmentations
Applies a random sequence of available augmentations.
dataloader/augmentations.py:206
↓ 3 callersFunctionaugment_to_bounding_box
Converts a mask to its bounding box representation.
dataloader/augmentations.py:7
↓ 3 callersFunctionaugment_to_polygon_with_nested_holes
내부에 중첩된 구멍과 도형까지 모두 완벽하게 보존하는 다각형 마스크를 생성합니다.
dataloader/augmentations.py:99
↓ 3 callersFunctionaugment_with_temporal_occlusion
Applies a diverse set of temporal augmentations to randomly selected mask frames. For each frame selected for augmentation, one of the follow
dataloader/augmentations.py:221
↓ 3 callersMethodcheck_inputs
(self, image, height, width)
pipeline_svd_mask.py:181
↓ 3 callersMethodclose
(self)
train.py:94
↓ 3 callersMethodcrop_and_resize
(self, image, target_height, target_width)
dataloader/vos.py:260
↓ 3 callersMethodpredict
Predict mask from prompts Args: prompts: Dictionary with point_coords, point_labels, mask_input prom
demo/tools/base_segmenter.py:46
↓ 3 callersMethodrun
Runs the core inference process on a sequence of conditioning and mask frames. Args: cond_frames (list[Image.Image]): Li
pipeline_svd_mask.py:879
↓ 3 callersFunctionsave_video
Save frames as video file
demo/app.py:354
↓ 3 callersFunctiontensor_to_vae_latent
(t, vae)
train.py:267
↓ 2 callersFunction_compute_padding
Compute padding tuple.
train.py:154
↓ 2 callersMethod_encode_video_vae
( self, video_frames: torch.Tensor, # Expects (B, F, C, H, W) device: Uni
pipeline_svd_mask.py:543
↓ 2 callersFunction_gaussian_blur2d
(input, kernel_size, sigma)
train.py:219
↓ 2 callersMethod_pil_to_tensor
Converts a list of PIL images to a normalized video tensor.
pipeline_svd_mask.py:955
↓ 2 callersFunction_resize_with_aspect_ratio
Resizes an image maintaining its aspect ratio. The longest side of the image is scaled to the maximum of target_width and target_height.
inference_onestep_folder.py:25
↓ 2 callersMethod_tensor_to_vae_latent
Encodes a video tensor into the VAE's latent space.
pipeline_svd_mask.py:960
↓ 2 callersFunctionaugment_with_instability
Introduces instability to a mask by adding salt-and-pepper noise to imitate segmentation artifacts like holes and stray pixels. Args:
dataloader/augmentations.py:44
↓ 2 callersMethodcheck_inputs
(self, image, height, width)
pipeline_svd_mask.py:502
↓ 2 callersFunctionconv_gauss
(img, kernel)
src/matting_loss.py:122
↓ 2 callersMethodcrop_and_resize
(self, image, target_height, target_width)
dataloader/synthetic.py:136
↓ 2 callersFunctiondownsample
(x)
src/matting_loss.py:108
↓ 2 callersFunctiongauss_kernel
(size=5, device=torch.device('cpu'), channels=3)
src/matting_loss.py:96
↓ 2 callersFunctionget_augmented_image
(instance_idx, frame_idx)
data_pipeline/generate_synthetic.py:138
↓ 2 callersFunctionget_module_from_str
(module, path)
train.py:810
↓ 2 callersFunctionlaplacian_pyramid
(img, kernel, max_levels=3)
src/matting_loss.py:129
↓ 2 callersFunctionmask_painter
Paint mask on image with transparency Args: input_image: np.ndarray, (H, W, 3) input_mask: np.ndarray, (H, W), binary ma
demo/tools/painter.py:11
↓ 2 callersFunctionnormalize_for_image
(features)
train.py:1426
↓ 2 callersMethodtrack_video
Track object through video using SAM2 Args: frames: List of numpy arrays, [(H,W,3)]*n, uint8 RGB frames
demo/sam2_wrapper.py:39
↓ 1 callersMethod__init__
(self, max_levels=5, channels=3)
src/matting_loss.py:72
↓ 1 callersMethod__init__
( self, sample_size: Optional[int] = None, in_channels: int = 8, out_channels:
src/unet_spatio_temporal_condition.py:73
↓ 1 callersFunction_augment_by_resizing
(mask_image, downsample_factor)
inference_onestep_folder.py:153
↓ 1 callersFunction_augment_to_bounding_box
(mask_image)
inference_onestep_folder.py:99
↓ 1 callersFunction_augment_to_polygon
Converts all parts of a mask to simplified polygons, preserving all disconnected components. The level of simplification is controlled by
inference_onestep_folder.py:110
↓ 1 callersFunction_augment_with_temporal_occlusion
Applies a diverse set of temporal augmentations to randomly selected mask frames. For each frame selected for augmentation, one of the follow
inference_onestep_folder.py:161
↓ 1 callersMethod_encode_image
( self, image: PipelineImageInput, device: Union[str, torch.device],
pipeline_svd_mask.py:103
↓ 1 callersMethod_encode_image
( self, image: PipelineImageInput, device: Union[str, torch.device],
pipeline_svd_mask.py:424
↓ 1 callersMethod_encode_video_vae
( self, video_frames: torch.Tensor, # Expects (B, F, C, H, W) device: Uni
pipeline_svd_mask.py:729
↓ 1 callersFunction_get_add_time_ids
( fps, motion_bucket_id, noise_aug_strength, dtype,
train.py:1182
↓ 1 callersMethod_get_add_time_ids
( self, fps: int, motion_bucket_id: int, noise_aug_strength: f
pipeline_svd_mask.py:148
↓ 1 callersMethod_get_add_time_ids
( self, fps: int, motion_bucket_id: int, noise_aug_strength: f
pipeline_svd_mask.py:469
↓ 1 callersMethod_get_add_time_ids
Creates the additional time IDs for conditioning the UNet.
pipeline_svd_mask.py:968
↓ 1 callersMethod_get_augmented_image
Applies geometric augmentations to a static foreground image.
dataloader/synthetic_on_the_fly.py:161
↓ 1 callersMethod_load_frames_from_s3
(self, frame_dir_s3_key, frame_indices, key_type)
dataloader/synthetic.py:114
↓ 1 callersMethod_load_sources
Scans directories listed in the config file to find fg/bg assets.
dataloader/synthetic_on_the_fly.py:117
↓ 1 callersMethod_resize_with_antialiasing
Resizes a tensor with anti-aliasing for CLIP input, mirroring k-diffusion. This is a direct copy of the helper function from your ori
pipeline_svd_mask.py:979
↓ 1 callersFunctionaugment_to_polygon
Converts a mask to a simplified polygon and back to a mask. The level of simplification is controlled by `simplification_tolerance`.
dataloader/augmentations.py:20
↓ 1 callersFunctioncalculate_depth_iterative
(root_index, current_depth)
dataloader/augmentations.py:115
↓ 1 callersFunctioncleanup_old_outputs
Remove output files older than max_age_minutes to prevent storage overflow This runs periodically to clean up abandoned files
demo/app.py:388
↓ 1 callersFunctioncleanup_old_videos
Remove old output videos to save storage space
demo/app.py:374
↓ 1 callersMethoddecode_latents
(self, latents: torch.Tensor, num_frames: int, decode_chunk_size: int = 14)
pipeline_svd_mask.py:168
↓ 1 callersMethoddecode_latents
(self, latents: torch.Tensor, num_frames: int, decode_chunk_size: int = 14)
pipeline_svd_mask.py:489
↓ 1 callersMethoddecode_latents
(self, latents: torch.Tensor, num_frames: int, decode_chunk_size: int)
pipeline_svd_mask.py:716
↓ 1 callersFunctionencode_image
(pixel_values)
train.py:1161
↓ 1 callersFunctionexpand_conv_in_channels
Expands the input channels of the `conv_in` layer of the UNet and updates the config. The original weights are preserved. The new weights fo
src/unet_spatio_temporal_condition.py:495
↓ 1 callersFunctionexport_to_video
(video_frames, output_video_path, fps)
train.py:235
↓ 1 callersFunctionextract_frames_from_video
Extract frames from video file Args: video_path: Path to video file max_frames: Maximum number of frames to extract (def
demo/app.py:57
↓ 1 callersMethodget_first_frame_mask
Get mask for first frame only (for preview) Args: frame: np.ndarray, (H, W, 3), uint8 RGB frame poin
demo/sam2_wrapper.py:106
↓ 1 callersFunctioninitialize_models
Initialize SAM2 and VideoMaMa models
demo/app.py:41
↓ 1 callersFunctionload_image_sequence
Loads a sequence of images and corresponding masks from folders.
inference_onestep_folder.py:52
↓ 1 callersFunctionload_sam2_tracker
Load SAM2 video tracker with pretrained weights Args: device: Device to run on Returns: SAM2VideoTracker in
demo/sam2_wrapper.py:156
↓ 1 callersFunctionload_videomama_pipeline
Load VideoMaMa pipeline with pretrained weights Args: device: Device to run on Returns: VideoInferencePipel
demo/videomama_wrapper.py:63
↓ 1 callersFunctionmain
()
train.py:723
↓ 1 callersFunctionparse_args
()
train.py:292
↓ 1 callersMethodprepare_latents
( self, batch_size: int, num_frames: int, height: int,
pipeline_svd_mask.py:191
↓ 1 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
src/unet_spatio_temporal_condition.py:278
↓ 1 callersMethodset_attn_processor
(self, processor: Union[AttentionProcessor, Dict[str, AttentionProcessor]])
src/unet_spatio_temporal_condition.py:683
↓ 1 callersMethodsobel_kernel
(self)
src/matting_loss.py:201
↓ 1 callersFunctionupsample
(x)
src/matting_loss.py:112
↓ 1 callersFunctionvideomama
Run VideoMaMa inference on video frames with mask conditioning Args: pipeline: VideoInferencePipeline instance frames_np
demo/videomama_wrapper.py:20
↓ 1 callersFunctionweight_pyramid
(x, max_levels=3)
src/matting_loss.py:142
Method__call__
( self, image: Union[List[PIL.Image.Image], torch.Tensor], mask_image: Uni
pipeline_svd_mask.py:248
Method__call__
( self, image: Union[List[PIL.Image.Image], torch.Tensor], mask_image: Uni
pipeline_svd_mask.py:561
Method__call__
( self, image: Union[PIL.Image.Image, torch.Tensor], # Static image for appearance
pipeline_svd_mask.py:747
Method__call__
(self, current_estimate, ground_truth, device, weight_dtype, sigmas=None)
src/matting_loss.py:31
Method__getitem__
Generates a single synthetic video clip and its corresponding masks. This method contains the core logic from `generate_video`.
dataloader/synthetic_on_the_fly.py:184
Method__getitem__
(self, idx)
dataloader/vos.py:158
Method__getitem__
(self, idx)
dataloader/synthetic.py:149
Method__init__
( self, vae: AutoencoderKLTemporalDecoder, image_encoder: CLIPVisionModelW
pipeline_svd_mask.py:83
Method__init__
( self, vae: AutoencoderKLTemporalDecoder, image_encoder: CLIPVisionModelW
pipeline_svd_mask.py:404
Method__init__
( self, vae: AutoencoderKLTemporalDecoder, unet: UNetSpatioTemporalConditi
pipeline_svd_mask.py:689
Method__init__
(self, module)
train.py:87
Method__init__
(self, in_dim, out_dim, hidden_dim=1024)
train.py:101
Method__init__
Initializes the on-the-fly dataset generator. Args: config_file (str): Path to the YAML config file specifying fg/bg sou
dataloader/synthetic_on_the_fly.py:49
Method__init__
(self, root_path, num_frames=16, height=576, width=1024, mask_augmentation="none", simplifica
dataloader/vos.py:40
Method__init__
( self, s3_bucket, s3_prefix, s3_metadata_key, num
dataloader/synthetic.py:35
Method__init__
(self, l1_weight=1.0, lap_weight=5.0, gradient_weight=1.0)
src/matting_loss.py:15
Method__init__
(self, eps=1e-6)
src/matting_loss.py:153
next →1–100 of 168, ranked by callers