Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,7 @@ def F1_score(y_true, y_pred):
|
|
| 37 |
return f1_val
|
| 38 |
|
| 39 |
|
| 40 |
-
model = load_model(r"Model
|
| 41 |
-
custom_objects={"F1_score": f1_score})
|
| 42 |
-
|
| 43 |
|
| 44 |
def med_image_recog(img_path):
|
| 45 |
img = cv2.imread(img_path)
|
|
@@ -56,5 +54,5 @@ def med_image_recog(img_path):
|
|
| 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()
|
|
|
|
| 37 |
return f1_val
|
| 38 |
|
| 39 |
|
| 40 |
+
model = load_model(r"MedImageRecog/Model/Model.h5", custom_objects={"F1_score": f1_score})
|
|
|
|
|
|
|
| 41 |
|
| 42 |
def med_image_recog(img_path):
|
| 43 |
img = cv2.imread(img_path)
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
app = gr.Interface(fn=med_image_recog, inputs=gr.Image(image_mode="L", type="filepath", label="Input Image"),
|
| 57 |
+
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 - Sistema de Reconhecimento de Imagens Médicas")
|
| 58 |
app.launch()
|