Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HF integration #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion models_cpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

from timm.models.vision_transformer import PatchEmbed, Block

from huggingface_hub import PyTorchModelHubMixin


import numpy as np


class MaskedAutoencoderViT(nn.Module):
class MaskedAutoencoderViT(nn.Module, PyTorchModelHubMixin, repo_url="https://github.com/MCG-NJU/CoMAE.git", pipeline_tag=["image-feature-extraction"]):

def __init__(self, img_size=224, patch_size=16, in_chans=3,
embed_dim=1024, depth=24, num_heads=16,
Expand Down
4 changes: 3 additions & 1 deletion models_mm_mae.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

from util.pos_embed import get_2d_sincos_pos_embed

from huggingface_hub import PyTorchModelHubMixin


class MaskedAutoencoderViT(nn.Module):

class MaskedAutoencoderViT(nn.Module, PyTorchModelHubMixin, repo_url="https://github.com/MCG-NJU/CoMAE.git", pipeline_tag=["image-feature-extraction"]):
""" Masked Autoencoder with VisionTransformer backbone
"""

Expand Down