Update README.md
Browse files
README.md
CHANGED
|
@@ -2,4 +2,33 @@
|
|
| 2 |
license: apache-2.0
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: image-classification
|
| 5 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: image-classification
|
| 5 |
+
---
|
| 6 |
+
# body_complexion
|
| 7 |
+
|
| 8 |
+
This is a fine-tuned [microsoft/resnet-50](https://huggingface.co/microsoft/resnet-50) model. Dataset with men of
|
| 9 |
+
different bode complexion was used for fine-tuning.
|
| 10 |
+
|
| 11 |
+
### Intended Use:
|
| 12 |
+
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:
|
| 13 |
+
|
| 14 |
+
- Health and fitness platforms for body type analysis
|
| 15 |
+
- Clothing recommendation systems tailored for different body types
|
| 16 |
+
- Visual content moderation systems to filter images based on body type
|
| 17 |
+
|
| 18 |
+
### Launch
|
| 19 |
+
```python
|
| 20 |
+
import torch
|
| 21 |
+
from PIL import Image
|
| 22 |
+
from transformers import ResNetForImageClassification, AutoImageProcessor
|
| 23 |
+
|
| 24 |
+
processor = AutoImageProcessor.from_pretrained('glazzova/body_complexion')
|
| 25 |
+
model = ResNetForImageClassification.from_pretrained('glazzova/body_complexion')
|
| 26 |
+
image = Image.open('your_pic.jpeg')
|
| 27 |
+
inputs = processor(image, return_tensors="pt")
|
| 28 |
+
|
| 29 |
+
with torch.no_grad():
|
| 30 |
+
logits = model(**inputs).logits
|
| 31 |
+
|
| 32 |
+
# model predicts one of the 4 classes
|
| 33 |
+
predicted_label = logits.argmax(-1).item()
|
| 34 |
+
print(model.config.id2label[predicted_label])
|