# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("glazzova/body_type")
model = AutoModelForImageClassification.from_pretrained("glazzova/body_type")Quick Links
body_type
Эта модель дообучена на microsoft/resnet-50 с помощью датасета, который содержит фотографии мужчин разных телосложений. Модель может определяет являетесь ли вы качком, скуфом, дрищом или просто нормальным.
Запуск модели
import torch
from PIL import Image
from transformers import ResNetForImageClassification, AutoImageProcessor
processor = AutoImageProcessor.from_pretrained("glazzova/body_type")
model = ResNetForImageClassification.from_pretrained('glazzova/body_type')
image = Image.open('your_pic.jpeg')
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
# model predicts one of the 4 classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])
- Downloads last month
- 29
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="glazzova/body_type") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")