dsgt-snakeclef / save_pretrained.py
Anthony Miyaguchi
Add dino embeddings for offline inference
6c84b4c
raw
history blame
335 Bytes
from transformers import AutoImageProcessor, AutoModel
if __name__ == "__main__":
model_name = "facebook/dinov2-base"
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)
# save pretrained
processor.save_pretrained("dinov2")
model.save_pretrained("dinov2")