Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/apple/ml-4m
/ types & classes
Types & classes
183 in github.com/apple/ml-4m
⨍
Functions
1,193
◇
Types & classes
183
↓ 15 callers
Class
MultiModalDatasetFolder
A generic multi-modal dataset loader where the samples are arranged in this way: :: root/modality_a/class_x/xxx.ext root/modality_a/c
fourm/data/multimodal_dataset_folder.py:201
↓ 13 callers
Class
FourM
4M model. Args: encoder_embeddings: Dict of encoder embedding modules. decoder_embeddings: Dict of decoder embedding modules.
fourm/models/fm.py:54
↓ 13 callers
Class
FourMViT
Modified 4M model, adapted to behave as a simple RGB-only ViT. Args: img_size (int): Input image size. patch_size (int): Patch si
fourm/models/fm_vit.py:49
↓ 12 callers
Class
UnifiedDataTransform
fourm/data/modality_transforms.py:67
↓ 11 callers
Class
TokTransform
fourm/data/modality_transforms.py:602
↓ 9 callers
Class
RGBTransform
fourm/data/modality_transforms.py:198
↓ 9 callers
Class
UViT
UViT model = Conditional UNet with Transformer bottleneck blocks and optionalpatching. See https://arxiv.org/abs/2301.11093 for more details.
fourm/vq/models/uvit.py:528
↓ 6 callers
Class
AugmentOp
fourm/utils/timm/auto_augment.py:319
↓ 6 callers
Class
RandomCropImageAugmenter
fourm/data/image_augmenter.py:32
↓ 6 callers
Class
ResBlock
A residual block that can optionally change the number of channels. :param channels: the number of input channels. :param emb_channels: t
fourm/vq/models/unet/unet.py:163
↓ 5 callers
Class
CaptionTransform
fourm/data/modality_transforms.py:755
↓ 5 callers
Class
CenterCropImageAugmenter
fourm/data/image_augmenter.py:101
↓ 5 callers
Class
LayerNorm
Subclass torch's LayerNorm to handle fp16.
fourm/utils/clip/model.py:171
↓ 5 callers
Class
NetLinLayer
A single linear layer which does a 1x1 conv
fourm/vq/percept_losses/lpips.py:122
↓ 5 callers
Class
PreNorm
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:32
↓ 5 callers
Class
TimestepEmbedSequential
A sequential module that passes timestep embeddings to the children that support it as an extra input.
fourm/vq/models/unet/unet.py:88
↓ 4 callers
Class
CropSettingsTransform
fourm/data/modality_transforms.py:1335
↓ 4 callers
Class
GenerationSampler
Sampler that wraps a trained 4M model for generation use cases. Implements standard autoregressive, MaskGIT, and ROAR generation schemes with chai
fourm/models/generate.py:323
↓ 4 callers
Class
MaskTransform
fourm/data/modality_transforms.py:570
↓ 4 callers
Class
Mlp
fourm/vq/models/vit_models.py:145
↓ 4 callers
Class
SequentialCond
fourm/utils/hmr2_utils/hmr2/models/components/t_cond_mlp.py:41
↓ 4 callers
Class
UnifiedMasking
fourm/data/masking.py:131
↓ 3 callers
Class
AttentionBlock
An attention block that allows spatial positions to attend to each other. Originally ported from here, but adapted to the N-d case. https
fourm/vq/models/unet/unet.py:277
↓ 3 callers
Class
Downsample
A downsampling layer with an optional convolution. :param channels: channels in the inputs and outputs. :param use_conv: a bool determini
fourm/vq/models/unet/unet.py:134
↓ 3 callers
Class
DropPath
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
fourm/vq/models/vit_models.py:130
↓ 3 callers
Class
DropPath
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
fourm/models/fm_utils.py:78
↓ 3 callers
Class
GatedMlp
Implements SwiGLU and other gated feed-forward layers from Noam Shazeer's paper: https://arxiv.org/abs/2002.05202
fourm/models/fm_utils.py:129
↓ 3 callers
Class
IdentityTransform
fourm/data/modality_transforms.py:1352
↓ 3 callers
Class
Mlp
fourm/models/fm_utils.py:111
↓ 3 callers
Class
ModelEma
Model Exponential Moving Average (DEPRECATED) Keep a moving average of everything in the model state_dict (parameters and buffers). This ver
fourm/utils/timm/model_ema.py:16
↓ 3 callers
Class
NormalTransform
fourm/data/modality_transforms.py:289
↓ 3 callers
Class
PipelineCond
Pipeline for conditional image generation. This model inherits from `DiffusionPipeline`. Check the superclass documentation for the generic metho
fourm/vq/scheduling/diffusion_pipeline.py:37
↓ 3 callers
Class
PreTokenizedImageAugmenter
fourm/data/image_augmenter.py:78
↓ 3 callers
Class
SAMInstanceTransform
fourm/data/modality_transforms.py:384
↓ 3 callers
Class
ToNumpy
fourm/utils/timm/transforms.py:16
↓ 3 callers
Class
Upsample
An upsampling layer with an optional convolution. :param channels: channels in the inputs and outputs. :param use_conv: a bool determinin
fourm/vq/models/unet/unet.py:103
↓ 3 callers
Class
ViTDecoder
Transformer to map latent features back to images / feature maps. Args: out_channels: Number of output channels. patch_size:
fourm/vq/models/vit_models.py:504
↓ 3 callers
Class
ViTEncoder
Transformer to map images / feature maps to latent features. Args: in_channels: Number of input channels. patch_size: Patch s
fourm/vq/models/vit_models.py:338
↓ 2 callers
Class
Attention
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:60
↓ 2 callers
Class
Attention
fourm/vq/models/uvit.py:129
↓ 2 callers
Class
Attention
fourm/vq/models/vit_models.py:165
↓ 2 callers
Class
Attention
fourm/models/fm_utils.py:147
↓ 2 callers
Class
Block
fourm/vq/models/vit_models.py:232
↓ 2 callers
Class
Block
fourm/models/fm_utils.py:310
↓ 2 callers
Class
Bottleneck
fourm/utils/clip/model.py:15
↓ 2 callers
Class
ConvNeXtBlock
r""" ConvNeXt Block. There are two equivalent implementations: (1) DwConv -> LayerNorm (channels_first) -> 1x1 Conv -> GELU -> 1x1 Conv; all in (N
fourm/vq/models/vit_models.py:298
↓ 2 callers
Class
CrossAttention
fourm/models/fm_utils.py:182
↓ 2 callers
Class
DropPath
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
fourm/vq/models/uvit.py:88
↓ 2 callers
Class
DropTokenDropout
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:209
↓ 2 callers
Class
EmptyAugmenter
fourm/data/image_augmenter.py:181
↓ 2 callers
Class
FeedForward
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:45
↓ 2 callers
Class
HumanPoseTransform
fourm/data/modality_transforms.py:1009
↓ 2 callers
Class
MetadataTransform
fourm/data/modality_transforms.py:843
↓ 2 callers
Class
Mlp
fourm/vq/models/uvit.py:103
↓ 2 callers
Class
NoImageAugmenter
fourm/data/image_augmenter.py:61
↓ 2 callers
Class
NormAttention
fourm/models/fm_utils.py:222
↓ 2 callers
Class
QKVAttention
A module which performs QKV attention and splits in a different order.
fourm/vq/models/unet/unet.py:377
↓ 2 callers
Class
SMPL
fourm/utils/hmr2_utils/hmr2/models/smpl_wrapper.py:16
↓ 2 callers
Class
SmoothedValue
Track a series of values and provide access to smoothed values over a window or the global series average.
fourm/utils/logger.py:34
↓ 2 callers
Class
Transformer
fourm/utils/clip/model.py:209
↓ 2 callers
Class
ZeroTokenDropout
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:228
↓ 1 callers
Class
ActivationStatsHook
Iterates through each of `model`'s modules and matches modules using unix pattern matching based on `hook_fn_locs` and registers `hook_fn` to the
fourm/utils/timm/model.py:46
↓ 1 callers
Class
AdaptiveLayerNorm1D
fourm/utils/hmr2_utils/hmr2/models/components/t_cond_mlp.py:12
↓ 1 callers
Class
Attention
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:94
↓ 1 callers
Class
AttentionPool2d
fourm/utils/clip/model.py:61
↓ 1 callers
Class
AugMixAugment
AugMix Transform Adapted and improved from impl here: https://github.com/google-research/augmix/blob/master/imagenet.py From paper: 'AugMix:
fourm/utils/timm/auto_augment.py:721
↓ 1 callers
Class
AutoAugment
fourm/utils/timm/auto_augment.py:506
↓ 1 callers
Class
Block
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:133
↓ 1 callers
Class
Block
fourm/vq/models/uvit.py:226
↓ 1 callers
Class
BottleneckBlock
fourm/vq/models/mlp_models.py:19
↓ 1 callers
Class
BottleneckMLP
fourm/vq/models/mlp_models.py:75
↓ 1 callers
Class
CLIP
fourm/utils/clip/model.py:308
↓ 1 callers
Class
CaptionEmbTransform
fourm/data/modality_transforms.py:796
↓ 1 callers
Class
ColorPaletteTransform
fourm/data/modality_transforms.py:1174
↓ 1 callers
Class
ControlNetAdapterEmbedding
fourm/vq/models/controlnet.py:29
↓ 1 callers
Class
ControlNetConditioningEmbedding
fourm/vq/models/controlnet.py:65
↓ 1 callers
Class
ControlnetCond
fourm/vq/models/controlnet.py:102
↓ 1 callers
Class
CrossAttention
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:94
↓ 1 callers
Class
CrossAttention
fourm/vq/models/uvit.py:175
↓ 1 callers
Class
CrossAttention
fourm/vq/models/vit_models.py:200
↓ 1 callers
Class
DDIMSchedulerOutput
Output class for the scheduler's step function output. Args: prev_sample (`torch.FloatTensor` of shape `(batch_size, num_channels, h
fourm/vq/scheduling/scheduling_ddim.py:34
↓ 1 callers
Class
DDPMSchedulerOutput
Output class for the scheduler's step function output. Args: prev_sample (`torch.FloatTensor` of shape `(batch_size, num_channels, h
fourm/vq/scheduling/scheduling_ddpm.py:33
↓ 1 callers
Class
DecoderBlock
fourm/vq/models/uvit.py:256
↓ 1 callers
Class
DecoderBlock
fourm/models/fm_utils.py:337
↓ 1 callers
Class
DepthTransform
fourm/data/modality_transforms.py:245
↓ 1 callers
Class
DetectionTransform
fourm/data/modality_transforms.py:625
↓ 1 callers
Class
DiVAE
DiVAE ("Diffusion VQ-VAE") model = simple encoder + diffusion decoder with a discrete bottleneck, inspired by https://arxiv.org/abs/2206.00386.
fourm/vq/vqvae.py:498
↓ 1 callers
Class
DropPath
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:64
↓ 1 callers
Class
EmptyDataset
Empty dataset
fourm/utils/generation_datasets/empty_dataset.py:17
↓ 1 callers
Class
FrequencyEmbedder
fourm/utils/hmr2_utils/hmr2/models/components/t_cond_mlp.py:185
↓ 1 callers
Class
GroupNorm32
fourm/vq/models/unet/nn.py:30
↓ 1 callers
Class
HybridEmbed
CNN Feature Map Embedding Extract feature map from CNN, flatten, project to embedding dim.
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:184
↓ 1 callers
Class
ImageEncoderEmbedding
Embedding module for spatial inputs, like images or feature maps. Creates tokens from patches over the image. This adapter / embedding differ
fourm/models/encoder_embeddings.py:214
↓ 1 callers
Class
LPIPS
fourm/vq/percept_losses/lpips.py:66
↓ 1 callers
Class
LoRAWrapper
Low-Rank Adaptation Wrapper for linear layers. See https://arxiv.org/abs/2106.09685 Args: linear: nn.Linear layer to wrap
fourm/models/lora_utils.py:44
↓ 1 callers
Class
Memcodes
fourm/vq/quantizers/quantize_memcodes.py:25
↓ 1 callers
Class
MeshRenderer
fourm/utils/hmr2_utils/hmr2/utils/mesh_renderer.py:49
↓ 1 callers
Class
MixtureDataset
fourm/data/unified_datasets.py:524
↓ 1 callers
Class
Mlp
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:77
↓ 1 callers
Class
ModifiedResNet
A ResNet class that is similar to torchvision's but contains the following changes: - There are now 3 "stem" convolutions as opposed to 1, wi
fourm/utils/clip/model.py:100
next →
1–100 of 183, ranked by callers