MCPcopy Create free account

hub / github.com/apple/ml-4m / functions

Functions1,193 in github.com/apple/ml-4m

↓ 1 callersFunctionauto_augment_policy_originalr
(hparams)
fourm/utils/timm/auto_augment.py:459
↓ 1 callersFunctionauto_augment_policy_v0
(hparams)
fourm/utils/timm/auto_augment.py:359
↓ 1 callersFunctionauto_augment_policy_v0r
(hparams)
fourm/utils/timm/auto_augment.py:392
↓ 1 callersFunctionauto_augment_transform
Create a AutoAugment transform :param config_str: String defining configuration of auto augmentation. Consists of multiple sections separate
fourm/utils/timm/auto_augment.py:518
↓ 1 callersFunctionavailable_models
Returns the names of available CLIP models
fourm/utils/clip/clip.py:93
↓ 1 callersFunctionavg_pool_nd
Create a 1D, 2D, or 3D average pooling module.
fourm/vq/models/unet/nn.py:55
↓ 1 callersFunctionbasic_clean
(text)
fourm/utils/clip/simple_tokenizer.py:55
↓ 1 callersFunctionbatch_to_device
(mod_dict, device, domains)
fourm/utils/generation.py:40
↓ 1 callersMethodbboxes_crop_and_resize
Crop and resize bounding boxes Args: bboxes: Bounding boxes to crop and resize crop_coords: Coordinates of the crop (
fourm/data/modality_transforms.py:675
↓ 1 callersMethodbboxes_hflip
(self, bboxes: List[Tuple], image_size: Tuple, flip: bool)
fourm/data/modality_transforms.py:667
↓ 1 callersMethodbpe
(self, token)
fourm/utils/clip/simple_tokenizer.py:85
↓ 1 callersMethodbuild_attention_mask
(self)
fourm/utils/clip/model.py:392
↓ 1 callersFunctionbuild_model
(state_dict: dict)
fourm/utils/clip/model.py:467
↓ 1 callersFunctionbuild_smpl_head
(cfg)
fourm/utils/hmr2_utils/hmr2/models/heads/smpl_head.py:15
↓ 1 callersFunctionbuild_wds_fm_pretraining_dataloader
Builds the WebDataset FourM pre-training dataloader based on the given arguments. Args: data_path: Path to the dataset. all_d
fourm/data/unified_datasets.py:319
↓ 1 callersFunctioncam_crop_to_full
(cam_bbox, box_center, box_size, img_size, focal_length=5000.)
fourm/utils/hmr2_utils/hmr2/utils/renderer.py:20
↓ 1 callersMethodcat_decoder_tensors
Concatenate decoder tensors from different modalities. Args: mod_dict (dict): A dictionary containing information for eac
fourm/models/fm.py:279
↓ 1 callersFunctioncheck_dots
(s)
fourm/data/unified_datasets.py:152
↓ 1 callersFunctioncheck_overflow
(value)
fourm/vq/models/unet/fp16_util.py:249
↓ 1 callersFunctioncontains_nan
(tensor)
run_training_4m_fsdp.py:883
↓ 1 callersMethodconvert_bboxes_to_string
Convert bounding boxes to a string. xmin, ymin, xmax, ymax are mapped to v0, v1, v2, v3 special tokens. Args: bboxes: Bo
fourm/data/modality_transforms.py:703
↓ 1 callersMethodconvert_detection_instance
Convert instances dict to list of lists where each list takes the form: [xmin, ymin, xmax, ymax, class_name, score]
fourm/data/modality_transforms.py:659
↓ 1 callersMethodconvert_humanpose_instance
Convert instances dict to list of lists where each list takes the form: [human, xmin xmax ymin ymax global val1 val2 ... val10 pose val1 val2
fourm/data/modality_transforms.py:1016
↓ 1 callersMethodconvert_humanposes_to_string
Convert humanposes to a string range of global orientation: [-1, 1] range of object pose: [-1, 1] range of shape (bet
fourm/data/modality_transforms.py:1080
↓ 1 callersMethodconvert_palette_instance
Convert colors to v0= v0= ...
fourm/data/modality_transforms.py:1180
↓ 1 callersMethodconvert_palettes_to_string
Convert palettes to a string
fourm/data/modality_transforms.py:1191
↓ 1 callersFunctionconvert_string_to_bboxes
Converts a string of bboxes to a list of bboxes. Args: bboxes_str (str): String of bboxes bins (int): Number of bins (defaul
fourm/utils/plotting_utils.py:863
↓ 1 callersMethodconvert_target_tokens_to_string
(self, target_tokens)
fourm/data/modality_transforms.py:1273
↓ 1 callersMethodconvert_to_fp16
Convert the torso of the model to float16.
fourm/vq/models/unet/unet.py:633
↓ 1 callersFunctionconvert_weights
Convert applicable model parameters to fp16
fourm/utils/clip/model.py:443
↓ 1 callersFunctioncosine_schedule
(num_steps, total_tokens)
fourm/utils/generation.py:49
↓ 1 callersFunctioncreate_backbone
(cfg)
fourm/utils/hmr2_utils/hmr2/models/backbones/__init__.py:9
↓ 1 callersFunctioncreate_model
( in_channels=32, output_type="stats", vq_model=None, vae=None, )
fourm/vq/models/lm_models.py:162
↓ 1 callersFunctioncreate_raymond_lights
()
fourm/utils/hmr2_utils/hmr2/utils/mesh_renderer.py:20
↓ 1 callersFunctioncreate_superres_input
(out_dict, sr_cond_domains, sr_target_domains, sr_tokens_per_target, text_tokenizer, device)
run_generation.py:473
↓ 1 callersMethodcrop_sample
Crop the sample using crop coordinates.
fourm/data/modality_transforms.py:448
↓ 1 callersFunctiondecode_color_palette
Decodes a sequence of color palettes from a model dictionary. Args: mod_dict (dict): Model output dictionary. key (str): Key
fourm/utils/plotting_utils.py:357
↓ 1 callersFunctiondecode_human_poses
Decodes human poses tokenized with text + BMLP
fourm/utils/plotting_utils.py:375
↓ 1 callersFunctiondecode_input_rgb
Decodes (denormalizes) an RGB image from a model dictionary. Args: mod_dict (dict): Model output dictionary. key (str): Key
fourm/utils/plotting_utils.py:94
↓ 1 callersFunctiondecode_metadata
Decodes a sequence of metadata tokens into a dictionary of metadata. Args: mod_dict (dict): Model output dictionary. key (st
fourm/utils/plotting_utils.py:419
↓ 1 callersMethoddecode_quant
Decodes quantized latent codes back to an image. Args: quant: Quantized latent code of shape B D_Q H_Q W_Q Returns:
fourm/vq/vqvae.py:454
↓ 1 callersFunctiondecode_sam_instances
Decodes a sequence of SAM instance tokens into the instance representation. Args: mod_dict (dict): Model output dictionary.
fourm/utils/plotting_utils.py:512
↓ 1 callersFunctiondecode_tok_canny_edge
Decodes a sequence of Canny edges tokens from a model dictionary into an RGB image. Args: mod_dict (dict): Model output dictionary.
fourm/utils/plotting_utils.py:165
↓ 1 callersFunctiondecode_tok_clip
Decodes a sequence of CLIP tokens from a model dictionary into an PCA representation. Args: mod_dict (dict): Model output dictionary
fourm/utils/plotting_utils.py:271
↓ 1 callersFunctiondecode_tok_depth
Decodes a sequence of depth tokens from a model dictionary into an RGB image. Args: mod_dict (dict): Model output dictionary.
fourm/utils/plotting_utils.py:201
↓ 1 callersFunctiondecode_tok_dinov2
Decodes a sequence of DINOv2 spatial tokens from a model dictionary into an PCA representation. Args: mod_dict (dict): Model output
fourm/utils/plotting_utils.py:289
↓ 1 callersFunctiondecode_tok_dinov2_global
Decodes a sequence of DINOv2 global tokens from a model dictionary. Args: mod_dict (dict): Model output dictionary. key (str
fourm/utils/plotting_utils.py:327
↓ 1 callersFunctiondecode_tok_imagebind
Decodes a sequence of ImageBind spatial tokens from a model dictionary into an PCA representation. Args: mod_dict (dict): Model outp
fourm/utils/plotting_utils.py:308
↓ 1 callersFunctiondecode_tok_imagebind_global
Decodes a sequence of ImageBind global tokens from a model dictionary. Args: mod_dict (dict): Model output dictionary. key (
fourm/utils/plotting_utils.py:342
↓ 1 callersFunctiondecode_tok_normal
Decodes a sequence of surface normal tokens from a model dictionary into an RGB image. Args: mod_dict (dict): Model output dictionar
fourm/utils/plotting_utils.py:147
↓ 1 callersFunctiondecode_tok_rgb_controlnet
Decodes a sequence of RGB tokens from a model dictionary into an RGB image using a ControlNet. Args: mod_dict (dict): Model output d
fourm/utils/plotting_utils.py:123
↓ 1 callersFunctiondecode_tok_sam_edge
Decodes a sequence of SAM edges from a model dictionary into an RGB image. Args: mod_dict (dict): Model output dictionary. t
fourm/utils/plotting_utils.py:183
↓ 1 callersFunctiondecode_tok_semseg
Decodes a sequence of semantic segmentation tokens from a model dictionary into an RGB image. Args: rgb_img (torch.Tensor): RGB imag
fourm/utils/plotting_utils.py:233
↓ 1 callersFunctiondefault
(val, d)
fourm/vq/quantizers/quantize_lucid.py:29
↓ 1 callersFunctiondefault_bpe
()
fourm/utils/clip/simple_tokenizer.py:16
↓ 1 callersMethoddepth_to_tensor
(self, img)
fourm/data/modality_transforms.py:250
↓ 1 callersFunctiondownload
(url, local_path, chunk_size=1024)
fourm/vq/percept_losses/lpips.py:40
↓ 1 callersFunctiondrop_path
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for Ef
fourm/vq/models/vit_models.py:112
↓ 1 callersFunctiondrop_path
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). Implementation from timm: https://github.com/huggingface
fourm/models/fm_utils.py:64
↓ 1 callersMethodencode_image
(self, image, return_side_out=False, return_all_tokens=False, return_all_final_tokens=False, **kwargs)
fourm/utils/clip/model.py:404
↓ 1 callersMethodencode_text
(self, text, return_all_tokens=False, return_patch_tokens=False)
fourm/utils/clip/model.py:407
↓ 1 callersFunctionexists
(val)
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:22
↓ 1 callersFunctionexpand_to_batch
(mod_dict, batch_size)
fourm/models/generate.py:185
↓ 1 callersMethodexpire_codes_
(self, batch_samples)
fourm/vq/quantizers/quantize_lucid.py:245
↓ 1 callersMethodexpire_codes_
(self, batch_samples)
fourm/vq/quantizers/quantize_lucid.py:370
↓ 1 callersMethodextend_instance_points
Given an instance and a border function `border_fn`, extends the instance points with crossing points between the instance and the crop bord
fourm/data/modality_transforms.py:398
↓ 1 callersFunctionextract_modality_names
(s)
fourm/data/unified_datasets.py:227
↓ 1 callersFunctionfind_image_extension
(root_dir)
save_vq_tokens.py:40
↓ 1 callersMethodfloat_metadata_to_string
(self, metadata, key, vmin, vmax, bins)
fourm/data/modality_transforms.py:941
↓ 1 callersMethodforward
(self, image, text)
fourm/utils/clip/model.py:426
↓ 1 callersMethodforward
Forward pass of the encoder, quantizer, and decoder. Args: x: Input image tensor of shape B C H W or B H W in case
fourm/vq/vqvae.py:467
↓ 1 callersMethodforward
(self, x)
fourm/vq/models/unet/nn.py:26
↓ 1 callersMethodforward
(self, x)
fourm/vq/models/unet/unet.py:121
↓ 1 callersMethodforward_features
(self, x)
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:325
↓ 1 callersMethodforward_loss
Computes the loss based on the specified loss type. Args: y (torch.Tensor): Decoder output. Shape (B, M, D). target_i
fourm/models/fm.py:547
↓ 1 callersMethodforward_mask_decoder
Concatenates and mask decoder tensors based on provided modality information. This function consolidates decoder tokens from multiple modalit
fourm/models/fm.py:392
↓ 1 callersMethodforward_mask_decoder_maskgit
Modification of forward_mask_decoder for MaskGIT generation, with support for batching
fourm/models/generate.py:447
↓ 1 callersMethodforward_mask_decoder_roar
Modification of forward_mask_decoder for ROAR generation, with support for batching
fourm/models/generate.py:481
↓ 1 callersMethodforward_mask_encoder
Concatenates and mask encoder tensors based on provided modality information. This function consolidates encoder tokens from multiple modalit
fourm/models/fm.py:338
↓ 1 callersMethodforward_mod_loss
Computes the modality-wise loss. Args: y (torch.Tensor): Decoder tokens. Shape (B, M, D). target_ids (torch.Tensor):
fourm/models/fm.py:573
↓ 1 callersMethodforward_step
Run a forward step of the network Args: batch (Dict): Dictionary containing batch data train (bool): Flag ind
fourm/utils/hmr2_utils/hmr2/models/hmr2.py:56
↓ 1 callersMethodforward_token_loss
Computes the token-wise loss. Args: y (torch.Tensor): Decoder tokens. Shape (B, M, D). target_ids (torch.Tensor): Gro
fourm/models/fm.py:604
↓ 1 callersFunctionfreeze_batch_norm_2d
Converts all `BatchNorm2d` and `SyncBatchNorm` layers of provided module into `FrozenBatchNorm2d`. If `module` is itself an instance of eithe
fourm/utils/timm/model.py:107
↓ 1 callersMethodfreeze_decoder
(self, freeze_embeddings=True)
fourm/models/fm.py:728
↓ 1 callersMethodfreeze_decoder_except_specific_embeddings
(self, frozen_embedding_domain)
fourm/models/fm.py:739
↓ 1 callersMethodfreeze_encoder
(self, freeze_embeddings=True)
fourm/models/fm.py:694
↓ 1 callersMethodfreeze_encoder_except_specific_embeddings
(self, frozen_embedding_domain)
fourm/models/fm.py:705
↓ 1 callersMethodfreeze_params
(self)
fourm/vq/models/controlnet.py:216
↓ 1 callersMethodfuse_LoRA_into_linear
Returns a single nn.Linear layer with the LoRA matrix fused into the original one.
fourm/models/lora_utils.py:71
↓ 1 callersFunctiongenerate
(gen_sampler, gen_sampler_sr, tokenizers, text_tokenizer, data_loader, device, dtype, args)
run_generation.py:633
↓ 1 callersFunctiongenerate_coord_tokens
Extra tokens that are used for bounding box coordinates, xmin, ymin, xmax, ymax, but also other modalities like color maps, metadata, or pose
fourm/utils/tokenizer/text_tokenizer.py:21
↓ 1 callersFunctiongenerate_object_class_tokens
(dataset="coco")
fourm/utils/tokenizer/text_tokenizer.py:35
↓ 1 callersFunctiongenerate_sentinel_tokens
(num=100, start_id=0)
fourm/utils/tokenizer/text_tokenizer.py:13
↓ 1 callersFunctionget_args
Parses the arguments from the command line.
run_training_vqcontrolnet.py:92
↓ 1 callersFunctionget_args
(args=None)
run_generation.py:69
↓ 1 callersFunctionget_args
Parses the arguments from the command line.
run_training_divae.py:93
↓ 1 callersFunctionget_args
Parses the arguments from the command line.
run_training_vqvae.py:97
↓ 1 callersFunctionget_args
()
train_wordpiece_tokenizer.py:20
↓ 1 callersFunctionget_args
()
run_training_4m.py:42
↓ 1 callersFunctionget_args
()
run_training_4m_fsdp.py:50
← previousnext →301–400 of 1,193, ranked by callers