File size: 294 Bytes
ab8b628 |
1 2 3 4 5 6 7 8 9 10 11 |
from transformers import ViTImageProcessor
from .utils import MODEL_DIR
processor = ViTImageProcessor.from_pretrained(MODEL_DIR)
def preprocess_image(image):
"""Preprocesses a single image for ViT inference."""
inputs = processor(images=image, return_tensors="pt")
return inputs
|