facebookresearch / MetaCLIP

ICLR2024 Spotlight: curation/training code, metadata, distribution and pre-trained models for MetaCLIP; CVPR 2024: MoDE: CLIP Data Experts via Clustering
Other
1.17k stars 49 forks source link

Feature Improvement: Automatically download and load MetaCLIP checkpoints #29

Closed Andy-LZH closed 9 months ago

Andy-LZH commented 10 months ago

Feature Improvement based on Issue #26

Code modified/added

Now loading MetaCLIP(ViT-B-32, ViT-B32-quickgelu, ViT-B-16, ViT-L-14) can be done as:

# Load MetaCLIP B32 400M
model, _, preprocess = open_clip.create_model_and_transforms('ViT-B-32-quickgelu', pretrained='metaclip400m')

# Load MetaCLIP B32 2.5B
model, _, preprocess = open_clip.create_model_and_transforms('ViT-B-32-quickgelu', pretrained='metaclip2_5b')

And thanks for reviewing this PR in advance.