Spaces:
Sleeping
Sleeping
new day
Browse files- .gradio/flagged/dataset1.csv +2 -0
- .gradio/flagged/img/2bf96196995f897eb82f/amanite.jpg +0 -0
- app.ipynb +0 -0
- app.py +6 -8
.gradio/flagged/dataset1.csv
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
img,output,timestamp
|
| 2 |
+
.gradio/flagged/img/2bf96196995f897eb82f/amanite.jpg,"{""label"": null, ""confidences"": null}",2025-05-24 11:07:40.000039
|
.gradio/flagged/img/2bf96196995f897eb82f/amanite.jpg
ADDED
|
app.ipynb
ADDED
|
File without changes
|
app.py
CHANGED
|
@@ -1,20 +1,18 @@
|
|
| 1 |
-
from
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
def which_champi(x): return x[0].isupper()
|
| 5 |
-
|
| 6 |
# Load the model
|
| 7 |
-
learn =
|
| 8 |
|
| 9 |
categories = ('amanite','bolet', 'morille', 'truffe')
|
| 10 |
|
| 11 |
def classify_image(img):
|
| 12 |
-
|
| 13 |
return dict(zip(categories, map(float,probs)))
|
| 14 |
|
| 15 |
-
image = gr.
|
| 16 |
-
label = gr.
|
| 17 |
-
examples = ['amanite.
|
| 18 |
|
| 19 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 20 |
intf.launch(inline=False)
|
|
|
|
| 1 |
+
from fastai.vision.all import *
|
| 2 |
import gradio as gr
|
| 3 |
|
|
|
|
|
|
|
| 4 |
# Load the model
|
| 5 |
+
learn = load_learner('modelchampi.pkl')
|
| 6 |
|
| 7 |
categories = ('amanite','bolet', 'morille', 'truffe')
|
| 8 |
|
| 9 |
def classify_image(img):
|
| 10 |
+
pred,idx,probs = learn.predict(img)
|
| 11 |
return dict(zip(categories, map(float,probs)))
|
| 12 |
|
| 13 |
+
image = gr.Image(height=192, width=192)
|
| 14 |
+
label = gr.Label()
|
| 15 |
+
examples = ['amanite.jpg', 'truffe.jpg']
|
| 16 |
|
| 17 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 18 |
intf.launch(inline=False)
|