Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,19 +12,20 @@ def classificar_imagem(file_name):
|
|
| 12 |
pred = new_model.predict(np.array([img]))
|
| 13 |
pred = np.round(pred, 1)
|
| 14 |
if pred == 0:
|
| 15 |
-
|
| 16 |
else:
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
-
imagem = gr.inputs.File(file_count=1, label="
|
| 22 |
-
|
| 23 |
|
| 24 |
gr.Interface(
|
| 25 |
fn=classificar_imagem,
|
| 26 |
inputs=imagem,
|
| 27 |
-
outputs=
|
| 28 |
interpretation="default",
|
| 29 |
live=True,
|
| 30 |
theme="dark-peach",
|
|
|
|
| 12 |
pred = new_model.predict(np.array([img]))
|
| 13 |
pred = np.round(pred, 1)
|
| 14 |
if pred == 0:
|
| 15 |
+
pred_label = "Benigno"
|
| 16 |
else:
|
| 17 |
+
pred_label = "Maligno"
|
| 18 |
+
pred_score = f"{float(pred) * 100:.2f}%"
|
| 19 |
+
return pred_label, pred_score
|
| 20 |
|
| 21 |
|
| 22 |
+
imagem = gr.inputs.File(file_count=1, label="Imagem de mamografia")
|
| 23 |
+
resultado_diagnostico = [gr.outputs.Textbox(label="Diagn贸stico"), gr.outputs.Textbox(label="Confian莽a")]
|
| 24 |
|
| 25 |
gr.Interface(
|
| 26 |
fn=classificar_imagem,
|
| 27 |
inputs=imagem,
|
| 28 |
+
outputs=resultado_diagnostico,
|
| 29 |
interpretation="default",
|
| 30 |
live=True,
|
| 31 |
theme="dark-peach",
|