Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import tensorflow as tf
|
|
| 2 |
from keras.utils import custom_object_scope
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
| 5 |
-
from PIL import Image, ImageDraw
|
| 6 |
|
| 7 |
# Defina a camada personalizada FixedDropout
|
| 8 |
class FixedDropout(tf.keras.layers.Dropout):
|
|
@@ -55,13 +55,14 @@ def classify_image(inp):
|
|
| 55 |
# Converte a imagem de saída de volta para numpy array
|
| 56 |
output_image = np.array(output_image)
|
| 57 |
|
| 58 |
-
|
|
|
|
| 59 |
|
| 60 |
# Crie uma interface Gradio
|
| 61 |
iface = gr.Interface(
|
| 62 |
fn=classify_image,
|
| 63 |
inputs=gr.inputs.Image(shape=(192, 256)),
|
| 64 |
-
outputs=[gr.outputs.
|
| 65 |
capture_session=True,
|
| 66 |
title="Detecção de Catarata",
|
| 67 |
description="Esta interface permite a detecção de catarata em imagens de olhos.",
|
|
|
|
| 2 |
from keras.utils import custom_object_scope
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
| 5 |
+
from PIL import Image, ImageDraw
|
| 6 |
|
| 7 |
# Defina a camada personalizada FixedDropout
|
| 8 |
class FixedDropout(tf.keras.layers.Dropout):
|
|
|
|
| 55 |
# Converte a imagem de saída de volta para numpy array
|
| 56 |
output_image = np.array(output_image)
|
| 57 |
|
| 58 |
+
# Retorna uma lista com a imagem de entrada e o rótulo
|
| 59 |
+
return [inp, output_image], predicted_class
|
| 60 |
|
| 61 |
# Crie uma interface Gradio
|
| 62 |
iface = gr.Interface(
|
| 63 |
fn=classify_image,
|
| 64 |
inputs=gr.inputs.Image(shape=(192, 256)),
|
| 65 |
+
outputs=[gr.outputs.Multi([gr.outputs.Image(type="numpy"), gr.outputs.Image(type="numpy")]), gr.outputs.Label()],
|
| 66 |
capture_session=True,
|
| 67 |
title="Detecção de Catarata",
|
| 68 |
description="Esta interface permite a detecção de catarata em imagens de olhos.",
|