Instructions to use lucypatrice/flower-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastai
How to use lucypatrice/flower-classifier with fastai:
from huggingface_hub import from_pretrained_fastai learn = from_pretrained_fastai("lucypatrice/flower-classifier") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
library_name: fastai
|
| 4 |
+
tags:
|
| 5 |
+
- image-classification
|
| 6 |
+
- fastai
|
| 7 |
+
- computer-vision
|
| 8 |
+
---
|
| 9 |
+
# flower-classifier
|
| 10 |
+
|
| 11 |
+
This is an image classification model trained using fastai. It classifies images into the following categories:
|
| 12 |
+
`['golden_dewdrop', 'peepal_tree']`
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
- **Architecture**: `<function resnet34 at 0x7a5c724aa2a0>`
|
| 16 |
+
- **Image Size**: `224`
|
| 17 |
+
- **Training Data**: Custom dataset (flower images)
|
| 18 |
+
|
| 19 |
+
## How to use this model
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from fastai.vision.all import *
|
| 23 |
+
from huggingface_hub import hf_hub_download
|
| 24 |
+
|
| 25 |
+
# Download the model file
|
| 26 |
+
model_path = hf_hub_download(repo_id='lucypatrice/flower-classifier', filename='model.pkl')
|
| 27 |
+
|
| 28 |
+
# Load the fastai learner
|
| 29 |
+
learn = load_learner(model_path)
|
| 30 |
+
|
| 31 |
+
# Example prediction
|
| 32 |
+
img = PILImage.create('your_image.jpg') # Replace with your image path
|
| 33 |
+
pred, pred_idx, probs = learn.predict(img)
|
| 34 |
+
|
| 35 |
+
print(f"Prediction: {pred} (confidence {probs[pred_idx]:.2%})")
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Training Metrics
|
| 39 |
+
(You can add more detailed metrics, confusion matrices, etc. here after evaluating.)
|
| 40 |
+
|