Downloads · 30 days
9
10% of all-time downloads
callmealina/ViT_based_movie_identification_by_frame_lr1e-4_3epochs
ViT_based_movie_identification_by_frame_lr1e-4_3epochs is a image classification model from callmealina. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
This model is designed to identify movies based on a single frame. It is a fine-tuned version of the Vision Transformer (ViT), specifically the google/vit-base-patch16-224-in21k architecture.
Downloads · 30 days
9
10% of all-time downloads
All-time downloads
91
Public
Parameters
86.4M
1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt692 MB · 50%
From the Hugging Face model README
This model is designed to identify movies based on a single frame. It is a fine-tuned version of the Vision Transformer (ViT), specifically the google/vit-base-patch16-224-in21k architecture.
The model was trained to classify frames into specific movie titles from Movie Identification Dataset [800 Movies].
The following settings were used during fine-tuning:
from transformers import ViTImageProcessor, ViTForImageClassification
# 1. Downloading the processor and model from repository
model_id = "callmealina/ViT_based_movie_identification_by_frame_lr1e-4_3epochs"
processor = ViTImageProcessor.from_pretrained(model_id)
model = ViTForImageClassification.from_pretrained(model_id)
# 2. Preprocess a single frame
image = Image.open("frame_0027.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
3. Inference
model.eval()
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
# 4. Print the result (name of a film)
predicted_label = model.config.id2label[predicted_class_idx]
print(f"Predicted Movie: {predicted_label}")