Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,13 +17,20 @@ def predict(image):
|
|
17 |
mask = (mask[0] > 0.5).astype(np.uint8) * 255
|
18 |
mask = cv2.resize(mask, (original_width, original_height))
|
19 |
return mask
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
if __name__ == "__main__":
|
29 |
iface.launch(share=True)
|
|
|
17 |
mask = (mask[0] > 0.5).astype(np.uint8) * 255
|
18 |
mask = cv2.resize(mask, (original_width, original_height))
|
19 |
return mask
|
20 |
+
|
21 |
+
with gr.Blocks() as iface:
|
22 |
+
gr.Markdown("# Tooth Segmentation Model")
|
23 |
+
gr.Markdown("Upload a dental X-ray image to generate the annotation mask.")
|
24 |
|
25 |
+
with gr.Row():
|
26 |
+
with gr.Column():
|
27 |
+
input_image = gr.Image(type="numpy", label="Input X-ray Image")
|
28 |
+
submit_button = gr.Button("Predict")
|
29 |
+
|
30 |
+
with gr.Column():
|
31 |
+
output_image = gr.Image(type="numpy", label="Annotation Mask")
|
32 |
+
|
33 |
+
submit_button.click(fn=predict, inputs=input_image, outputs=output_image)
|
34 |
|
35 |
if __name__ == "__main__":
|
36 |
iface.launch(share=True)
|