jeysshon commited on
Commit
dbcd7b8
1 Parent(s): 252a06d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -49,10 +49,14 @@ class ADA_SKIN(object):
49
  return
50
 
51
  def _predict_image(self, img, cat):
 
 
52
  pred, idx, probs = learn.predict(img)
53
  return dict(zip(cat, map(float, probs)))
54
 
55
  def _predict_image2(self, img, cat):
 
 
56
  pred, idx, probs = learn2.predict(img)
57
  return dict(zip(cat, map(float, probs)))
58
 
@@ -121,7 +125,7 @@ maxi.categories = learn.dls.vocab
121
  maxi.categories2 = learn2.dls.vocab
122
 
123
  # Crear la interfaz de Gradio
124
- hf_image = gr.Image(type='pil') # Se elimina el argumento 'shape'
125
  hf_plot = gr.Plot()
126
 
127
  intf = gr.Interface(fn=maxi.predict_donut,
 
49
  return
50
 
51
  def _predict_image(self, img, cat):
52
+ # Convertir la imagen a PILImage
53
+ img = PILImage.create(img)
54
  pred, idx, probs = learn.predict(img)
55
  return dict(zip(cat, map(float, probs)))
56
 
57
  def _predict_image2(self, img, cat):
58
+ # Convertir la imagen a PILImage
59
+ img = PILImage.create(img)
60
  pred, idx, probs = learn2.predict(img)
61
  return dict(zip(cat, map(float, probs)))
62
 
 
125
  maxi.categories2 = learn2.dls.vocab
126
 
127
  # Crear la interfaz de Gradio
128
+ hf_image = gr.Image() # Se elimina el argumento 'type' porque no es necesario
129
  hf_plot = gr.Plot()
130
 
131
  intf = gr.Interface(fn=maxi.predict_donut,