DHEIVER commited on
Commit
177137f
1 Parent(s): e424807

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- pred = "Benigno"
16
  else:
17
- pred = "Maligno"
18
- return pred
 
19
 
20
 
21
- imagem = gr.inputs.File(file_count=1, label="Arquivo a ser analisado (extens茫o .pgm)")
22
- texto_saida = gr.outputs.Textbox(label="Resultado do diagn贸stico")
23
 
24
  gr.Interface(
25
  fn=classificar_imagem,
26
  inputs=imagem,
27
- outputs=texto_saida,
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",