Instructions to use glazzova/body_type with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use glazzova/body_type with Transformers:
# 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")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("glazzova/body_type") model = AutoModelForImageClassification.from_pretrained("glazzova/body_type") - Notebooks
- Google Colab
- Kaggle
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
- 22