Downloads · 30 days
6
24% of all-time downloads
m7kael/yachtmaster-boat-classifier
yachtmaster-boat-classifier is a image classification model from m7kael. 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.
A Vision Transformer (ViT) model fine-tuned to classify boat images into 5 categories: - cruising: Photos of boats underway on the water - exterior: Static dock, marina, or anchored views - interior: Cabin, salon, gal…
Downloads · 30 days
6
24% of all-time downloads
All-time downloads
25
Public
Parameters
85.8M
343 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors343 MB · 100%
From the Hugging Face model README
A Vision Transformer (ViT) model fine-tuned to classify boat images into 5 categories:
from transformers import ViTImageProcessor, ViTForImageClassification
from PIL import Image
# Load model and processor
processor = ViTImageProcessor.from_pretrained("m7kael/yachtmaster-boat-classifier")
model = ViTForImageClassification.from_pretrained("m7kael/yachtmaster-boat-classifier")
# Load image
image = Image.open("boat.jpg")
# Process and predict
inputs = processor(image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# Get predictions
predicted_class_idx = logits.argmax(-1).item()
predicted_class = model.config.id2label[predicted_class_idx]
print(f"Predicted class: {predicted_class}")
import requests
API_URL = "https://api-inference.huggingface.co/models/m7kael/yachtmaster-boat-classifier"
headers = {"Authorization": "Bearer YOUR_TOKEN"}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
# Example
result = query("boat.jpg")
print(result)
Based on test set evaluation:
Fine-tuned from google/vit-base-patch16-224-in21k on custom boat image dataset.
This model is released under the Apache 2.0 license.