v-mdd-2000 / README.md
eligapris's picture
transformers
f43cb71 verified
---
tags:
- image-classification
- climate
- biology
base_model: microsoft/resnet-50
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
example_title: Tiger
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg
example_title: Teapot
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
example_title: Palace
license: apache-2.0
metrics:
- accuracy
- bertscore
pipeline_tag: image-classification
library_name: transformers
---
# Model Trained Using AutoTrain
- Problem type: Image Classification
<!-- ## Validation Metrics
loss: 0.5462027192115784
f1_macro: 0.38996247906197656
f1_micro: 0.737093690248566
f1_weighted: 0.6627689294144399
precision_macro: 0.3467645553924699
precision_micro: 0.737093690248566
precision_weighted: 0.6320379754980795
recall_macro: 0.49719101123595505
recall_micro: 0.737093690248566
recall_weighted: 0.737093690248566
accuracy: 0.737093690248566 -->
# Image Classification Model Results (AutoTrain)
## Validation Metrics
| Metric | Value |
|--------|-------|
| Loss | 0.5462 |
| Accuracy | 0.7371 |
### F1 Scores
| Type | Value |
|------|-------|
| Macro | 0.3900 |
| Micro | 0.7371 |
| Weighted | 0.6628 |
### Precision
| Type | Value |
|------|-------|
| Macro | 0.3468 |
| Micro | 0.7371 |
| Weighted | 0.6320 |
### Recall
| Type | Value |
|------|-------|
| Macro | 0.4972 |
| Micro | 0.7371 |
| Weighted | 0.7371 |
## How to use
This model is designed for image classification. Here's how you can use it:
```python
from transformers import AutoImageProcessor, AutoModelForImageClassification
import torch
from PIL import Image
model_name = "eligapris/v-mdd-2000"
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(model_name)
image = Image.open("path_to_your_image.jpg")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])