DHEIVER commited on
Commit
af3816c
·
1 Parent(s): 7806a41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,7 +41,7 @@ model = load_model(r"Model\Model.h5",
41
  custom_objects={"F1_score": f1_score})
42
 
43
 
44
- def image_recognition(img_path):
45
  img = cv2.imread(img_path)
46
  img = cv2.resize(img, (250, 224))
47
  x = np.expand_dims(img, axis=0)
@@ -55,6 +55,6 @@ def image_recognition(img_path):
55
  return str(predicted_class + " detected with a confidence of " + confidence + "%")
56
 
57
 
58
- app = gr.Interface(fn=image_recognition, inputs=gr.Image(image_mode="L", type="filepath", label="Input Image"),
59
- outputs=gr.Label(label="Model Prediction"), allow_flagging="never", examples=[r"demo\Cyst.jpg", r"demo\Normal.jpg", r"demo\Stone.jpg", r"demo\Tumor.jpg"], title="Sistema de Reconhecimento de Imagens Médicas")
60
  app.launch()
 
41
  custom_objects={"F1_score": f1_score})
42
 
43
 
44
+ def med_image_recog(img_path):
45
  img = cv2.imread(img_path)
46
  img = cv2.resize(img, (250, 224))
47
  x = np.expand_dims(img, axis=0)
 
55
  return str(predicted_class + " detected with a confidence of " + confidence + "%")
56
 
57
 
58
+ app = gr.Interface(fn=med_image_recog, inputs=gr.Image(image_mode="L", type="filepath", label="Input Image"),
59
+ outputs=gr.Label(label="Model Prediction"), allow_flagging="never", examples=[r"demo\Cyst.jpg", r"demo\Normal.jpg", r"demo\Stone.jpg", r"demo\Tumor.jpg"], title="MedImageRecog")
60
  app.launch()