Instructions to use smaciu/bee-wings-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastai
How to use smaciu/bee-wings-classifier with fastai:
from huggingface_hub import from_pretrained_fastai learn = from_pretrained_fastai("smaciu/bee-wings-classifier") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,9 +5,9 @@ tags:
|
|
| 5 |
|
| 6 |
# ResNet
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
Disclaimer: The team releasing ResNet did not write a model card for this model so this model card has been written by the Hugging Face team.
|
| 11 |
|
| 12 |
## Model description
|
| 13 |
|
|
@@ -23,19 +23,18 @@ fine-tuned versions on a task that interests you.
|
|
| 23 |
|
| 24 |
```python
|
| 25 |
|
| 26 |
-
from huggingface_hub import from_pretrained_fastai
|
| 27 |
from fastai.vision.all import *
|
|
|
|
| 28 |
def label_func(f): return f.name[:2]
|
| 29 |
|
| 30 |
-
|
| 31 |
learn = from_pretrained_fastai("smaciu/bee-wings-classifier")
|
| 32 |
|
| 33 |
-
|
| 34 |
def predict_image(image_path):
|
| 35 |
img = PILImage.create(image_path)
|
| 36 |
bee,_,probs = learn.predict(img)
|
| 37 |
return bee, max(probs)
|
| 38 |
|
|
|
|
| 39 |
cat, prob = predict_image('path_to_image')
|
| 40 |
print(f"Honey bee from: {cat}. {100*prob.item():.2f}%")
|
| 41 |
|
|
|
|
| 5 |
|
| 6 |
# ResNet
|
| 7 |
|
| 8 |
+
Fastai ResNet18 model trained on Collection of wing images for conservation of honey bees (Apis mellifera) biodiversity in Europe https://zenodo.org/record/7244070
|
| 9 |
+
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model description
|
| 13 |
|
|
|
|
| 23 |
|
| 24 |
```python
|
| 25 |
|
|
|
|
| 26 |
from fastai.vision.all import *
|
| 27 |
+
from huggingface_hub import from_pretrained_fastai
|
| 28 |
def label_func(f): return f.name[:2]
|
| 29 |
|
|
|
|
| 30 |
learn = from_pretrained_fastai("smaciu/bee-wings-classifier")
|
| 31 |
|
|
|
|
| 32 |
def predict_image(image_path):
|
| 33 |
img = PILImage.create(image_path)
|
| 34 |
bee,_,probs = learn.predict(img)
|
| 35 |
return bee, max(probs)
|
| 36 |
|
| 37 |
+
# modify the 'path_to_image' with your own path
|
| 38 |
cat, prob = predict_image('path_to_image')
|
| 39 |
print(f"Honey bee from: {cat}. {100*prob.item():.2f}%")
|
| 40 |
|