ProyectoVision commited on
Commit
e3db7cb
·
1 Parent(s): 1721a43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -73,13 +73,15 @@ def image_mod(img_original):
73
  img_resultante = cv.addWeighted(img_mod, 1 - alpha, cv.cvtColor(th, cv.COLOR_GRAY2BGR), alpha, 0)
74
 
75
  image_with_predictions = img_resultante.resize((ancho, alto))
 
 
76
  return image_with_predictions
77
 
78
  #Obtener el numero de objetos de cada clase y el nombre
79
 
80
  demo = gr.Interface(
81
  image_mod,
82
- gr.Image(type="numpy"),
83
  "image",
84
  examples=[
85
  os.path.join(os.path.abspath(''), "Test/Imagen_1.jpg"),
 
73
  img_resultante = cv.addWeighted(img_mod, 1 - alpha, cv.cvtColor(th, cv.COLOR_GRAY2BGR), alpha, 0)
74
 
75
  image_with_predictions = img_resultante.resize((ancho, alto))
76
+ image_with_predictions = Image.fromarray(image_with_predictions[..., ::-1]) # RGB PIL image
77
+
78
  return image_with_predictions
79
 
80
  #Obtener el numero de objetos de cada clase y el nombre
81
 
82
  demo = gr.Interface(
83
  image_mod,
84
+ gr.Image(type="pil"),
85
  "image",
86
  examples=[
87
  os.path.join(os.path.abspath(''), "Test/Imagen_1.jpg"),