Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
from huggingface_hub import from_pretrained_fastai
|
| 2 |
import gradio as gr
|
| 3 |
-
from
|
| 4 |
|
| 5 |
repo_id = "paascorb/image-detection-efficientdet"
|
| 6 |
|
| 7 |
learner = from_pretrained_fastai(repo_id)
|
| 8 |
-
labels = learner.dls.vocab
|
| 9 |
|
| 10 |
# Definimos una funci贸n que se encarga de llevar a cabo las predicciones
|
| 11 |
def predict(img):
|
|
@@ -15,4 +14,5 @@ def predict(img):
|
|
| 15 |
return pred_dict["img"]
|
| 16 |
|
| 17 |
# Creamos la interfaz y la lanzamos.
|
| 18 |
-
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(128, 128)), outputs=gr.outputs.Image(shape(128,128)),
|
|
|
|
|
|
| 1 |
from huggingface_hub import from_pretrained_fastai
|
| 2 |
import gradio as gr
|
| 3 |
+
from icevision.all import *
|
| 4 |
|
| 5 |
repo_id = "paascorb/image-detection-efficientdet"
|
| 6 |
|
| 7 |
learner = from_pretrained_fastai(repo_id)
|
|
|
|
| 8 |
|
| 9 |
# Definimos una funci贸n que se encarga de llevar a cabo las predicciones
|
| 10 |
def predict(img):
|
|
|
|
| 14 |
return pred_dict["img"]
|
| 15 |
|
| 16 |
# Creamos la interfaz y la lanzamos.
|
| 17 |
+
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(128, 128)), outputs=gr.outputs.Image(shape(128,128)),
|
| 18 |
+
examples=['raccoon-161.jpg','raccoon-162.jpg']).launch(share=False)
|