Instructions to use glazzova/body_complexion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use glazzova/body_complexion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="glazzova/body_complexion") 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_complexion") model = AutoModelForImageClassification.from_pretrained("glazzova/body_complexion") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("glazzova/body_complexion")
model = AutoModelForImageClassification.from_pretrained("glazzova/body_complexion")Quick Links
body_complexion
This is a fine-tuned microsoft/resnet-50 model. Dataset with men of different bode complexion was used for fine-tuning.
Intended Use:
The model is intended for image classification tasks specifically related to men's body types. It is designed to classify images into four categories based on body complexion: skinny, ordinary, overweight, and very muscular. The model can be utilized in applications such as:
- Health and fitness platforms for body type analysis
- Clothing recommendation systems tailored for different body types
- Visual content moderation systems to filter images based on body type
Launch
import torch
from PIL import Image
from transformers import ResNetForImageClassification, AutoImageProcessor
processor = AutoImageProcessor.from_pretrained('glazzova/body_complexion')
model = ResNetForImageClassification.from_pretrained('glazzova/body_complexion')
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
- 71
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="glazzova/body_complexion") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")