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")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("glazzova/body_type") model = AutoModelForImageClassification.from_pretrained("glazzova/body_type", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,12 +11,13 @@ pipeline_tag: image-classification
|
|
| 11 |
|
| 12 |
### Запуск модели
|
| 13 |
```python
|
|
|
|
| 14 |
from PIL import Image
|
| 15 |
-
from transformers import ResNetForImageClassification
|
| 16 |
|
| 17 |
processor = AutoImageProcessor.from_pretrained("glazzova/body_type")
|
| 18 |
model = ResNetForImageClassification.from_pretrained('glazzova/body_type')
|
| 19 |
-
image = Image.open('
|
| 20 |
inputs = processor(image, return_tensors="pt")
|
| 21 |
|
| 22 |
with torch.no_grad():
|
|
|
|
| 11 |
|
| 12 |
### Запуск модели
|
| 13 |
```python
|
| 14 |
+
import torch
|
| 15 |
from PIL import Image
|
| 16 |
+
from transformers import ResNetForImageClassification, AutoImageProcessor
|
| 17 |
|
| 18 |
processor = AutoImageProcessor.from_pretrained("glazzova/body_type")
|
| 19 |
model = ResNetForImageClassification.from_pretrained('glazzova/body_type')
|
| 20 |
+
image = Image.open('/Users/swag2004/Downloads/photo_2024-05-11 16.17.08.jpeg')
|
| 21 |
inputs = processor(image, return_tensors="pt")
|
| 22 |
|
| 23 |
with torch.no_grad():
|