Spaces:
Sleeping
Sleeping
ShivamPathak
commited on
Commit
β’
ab576c3
1
Parent(s):
0d5246c
app.py is correted
Browse files- app.py +25 -0
- app.ipynb β app2.ipynb +0 -0
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
|
2 |
+
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['categories', 'image', 'label', 'examples', 'intf', 'classify_image']
|
5 |
+
|
6 |
+
# %% ../app.ipynb 1
|
7 |
+
from fastai.vision.all import *
|
8 |
+
import gradio as gr
|
9 |
+
|
10 |
+
|
11 |
+
# %% ../app.ipynb 5
|
12 |
+
categories = ('Elephantiasis','Normal Leg','Normal Skin','Ringworm','Skin Acne', 'Skin Cancer')
|
13 |
+
|
14 |
+
def classify_image(img):
|
15 |
+
pred,idx,probs = learn.predict(img)
|
16 |
+
return dict(zip(categories,map(float,probs)))
|
17 |
+
|
18 |
+
|
19 |
+
# %% ../app.ipynb 7
|
20 |
+
image = gr.inputs.Image(shape=(192,192))
|
21 |
+
label = gr.outputs.Label()
|
22 |
+
examples = ['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg']
|
23 |
+
|
24 |
+
intf = gr.Interface(fn = classify_image,inputs = image,outputs = label,examples= examples)
|
25 |
+
intf.launch(inline=False)
|
app.ipynb β app2.ipynb
RENAMED
File without changes
|