Spaces:
Runtime error
Runtime error
modified requirements.txt
Browse files- app.py +2 -2
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -4,14 +4,14 @@ from fastai.vision.widgets import *
|
|
| 4 |
import timm
|
| 5 |
import gradio as gr
|
| 6 |
categories = ('accident' , 'non-accident')
|
| 7 |
-
learn = load_learner('
|
| 8 |
def classify(img):
|
| 9 |
img = img.resize(224)
|
| 10 |
categories,index,probs = learn.predict(img)
|
| 11 |
return dict(zip(categories , map(float,probs)))
|
| 12 |
img = gr.inputs.Image(shape=(224))
|
| 13 |
label = gr.outputs.Label()
|
| 14 |
-
example = ['
|
| 15 |
|
| 16 |
iface = gr.Interface(fn=classify, inputs="image", outputs="label" , examples= example)
|
| 17 |
iface.launch()
|
|
|
|
| 4 |
import timm
|
| 5 |
import gradio as gr
|
| 6 |
categories = ('accident' , 'non-accident')
|
| 7 |
+
learn = load_learner('model.pkl')
|
| 8 |
def classify(img):
|
| 9 |
img = img.resize(224)
|
| 10 |
categories,index,probs = learn.predict(img)
|
| 11 |
return dict(zip(categories , map(float,probs)))
|
| 12 |
img = gr.inputs.Image(shape=(224))
|
| 13 |
label = gr.outputs.Label()
|
| 14 |
+
example = ['accident.jpg' , 'non-accident.jpg']
|
| 15 |
|
| 16 |
iface = gr.Interface(fn=classify, inputs="image", outputs="label" , examples= example)
|
| 17 |
iface.launch()
|
requirements.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
|
| 2 |
fastai
|
| 3 |
timm
|
|
|
|
| 1 |
+
fastbook
|
| 2 |
fastai
|
| 3 |
timm
|