paascorb commited on
Commit
f71bd31
1 Parent(s): a2b702a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,11 +1,10 @@
1
  from huggingface_hub import from_pretrained_fastai
2
  import gradio as gr
3
- from fastai.vision.all import *
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)),examples=['buildings.jpg','forest.jpg']).launch(share=False)
 
 
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)