Spaces:
Sleeping
Sleeping
dmitryhits
commited on
Commit
·
28bd75a
1
Parent(s):
9be3135
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', '
|
| 5 |
|
| 6 |
# %% ../weed_classifier.ipynb 1
|
| 7 |
from fastai.vision.all import *
|
|
@@ -18,11 +18,12 @@ 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
|
| 22 |
title = "Weed Classifier"
|
| 23 |
-
description = "A weed classifier trained on the Kaggle V2 Plant Seedling dataset with fastai
|
| 24 |
-
article="<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>Blog post</a></p>"
|
| 25 |
examples = ['SugarBeet.png']
|
| 26 |
interpretation='default'
|
| 27 |
enable_queue=True
|
|
|
|
|
|
|
| 28 |
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation).launch(enable_queue=enable_queue)
|
|
|
|
| 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 |
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>"
|
|
|
|
| 24 |
examples = ['SugarBeet.png']
|
| 25 |
interpretation='default'
|
| 26 |
enable_queue=True
|
| 27 |
+
|
| 28 |
+
# %% ../weed_classifier.ipynb 7
|
| 29 |
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation).launch(enable_queue=enable_queue)
|