Spaces:
Running
Running
dmitryhits
commited on
Commit
·
8976dd3
1
Parent(s):
28bd75a
change the article and description html
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../weed_classifier.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
-
__all__ = ['learn', 'labels', 'title', 'description', 'examples', 'interpretation', 'enable_queue', 'predict']
|
5 |
|
6 |
# %% ../weed_classifier.ipynb 1
|
7 |
from fastai.vision.all import *
|
@@ -18,6 +18,16 @@ def predict(img):
|
|
18 |
pred,pred_idx,probs = learn.predict(img)
|
19 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# %% ../weed_classifier.ipynb 6
|
22 |
title = "Weed Classifier"
|
23 |
description = "<h3 style='text-align: center'>A weed classifier trained on the Kaggle V2 Plant Seedling dataset with fastai.</h3>"
|
|
|
1 |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../weed_classifier.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
+
__all__ = ['learn', 'labels', 'article', 'title', 'description', 'examples', 'interpretation', 'enable_queue', 'predict']
|
5 |
|
6 |
# %% ../weed_classifier.ipynb 1
|
7 |
from fastai.vision.all import *
|
|
|
18 |
pred,pred_idx,probs = learn.predict(img)
|
19 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
20 |
|
21 |
+
# %% ../weed_classifier.ipynb 5
|
22 |
+
article = """<div>This model was trained on the dataset contains 5,539 images of crop and weed seedlings.
|
23 |
+
The images are grouped into 12 classes.
|
24 |
+
These classes represent common plant species in Danish agriculture at different growth stages.
|
25 |
+
A pretrained ResNet34 model was fine-tuned using fastai vision library. The error rate achived on the validation dataset is 2.5% after 4 epochs.
|
26 |
+
Currently the model does not generalize well on the out-of-domain images. Probably because of the specificity of the dataset.
|
27 |
+
The images in the dataset are of a single plant taken from the top and on a single background of a grit surface.
|
28 |
+
<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>Blog post</a></p>
|
29 |
+
</div>"""
|
30 |
+
|
31 |
# %% ../weed_classifier.ipynb 6
|
32 |
title = "Weed Classifier"
|
33 |
description = "<h3 style='text-align: center'>A weed classifier trained on the Kaggle V2 Plant Seedling dataset with fastai.</h3>"
|