Spaces:
Build error
Build error
Update app.py
Browse files
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
|
| 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=
|
| 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="
|
| 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()
|