This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from PIL import Image | |
| import open_clip | |
| from transformers import CLIPImageProcessor, CLIPTokenizer, CLIPConfig, CLIPModel | |
| config = CLIPConfig.from_pretrained("/Users/georgebredis/Downloads/MetaCLIP_b32_400m") | |
| model = CLIPModel(config).eval() | |
| _, _, preprocess = open_clip.create_model_and_transforms( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import os.path | |
| import torch | |
| import open_clip | |
| from open_clip import create_model | |
| from transformers import CLIPConfig, CLIPVisionConfig, CLIPTextConfig, CLIPModel | |