Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,19 +35,13 @@ def classify_image(inp):
|
|
35 |
# Obtém a classe prevista
|
36 |
predicted_class = class_names[np.argmax(prediction)]
|
37 |
|
38 |
-
|
39 |
-
inp = Image.fromarray(inp).resize((64, 64), Image.BICUBIC)
|
40 |
-
|
41 |
-
# Redimensione a imagem de saída para um tamanho menor (128x128)
|
42 |
-
out = inp.resize((128, 128), Image.BICUBIC)
|
43 |
-
|
44 |
-
return np.array(out), predicted_class
|
45 |
|
46 |
# Crie uma interface Gradio
|
47 |
iface = gr.Interface(
|
48 |
fn=classify_image,
|
49 |
inputs=gr.inputs.Image(shape=(192, 256)),
|
50 |
-
outputs=
|
51 |
)
|
52 |
|
53 |
# Inicie a interface Gradio
|
|
|
35 |
# Obtém a classe prevista
|
36 |
predicted_class = class_names[np.argmax(prediction)]
|
37 |
|
38 |
+
return predicted_class
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Crie uma interface Gradio
|
41 |
iface = gr.Interface(
|
42 |
fn=classify_image,
|
43 |
inputs=gr.inputs.Image(shape=(192, 256)),
|
44 |
+
outputs="label", # Apenas a classe prevista
|
45 |
)
|
46 |
|
47 |
# Inicie a interface Gradio
|