Spaces:
Sleeping
Sleeping
update output
Browse files
app.py
CHANGED
|
@@ -139,7 +139,8 @@ def predict_bone_age(Radiograph, Sex, Heatmap):
|
|
| 139 |
)
|
| 140 |
|
| 141 |
return (
|
| 142 |
-
|
|
|
|
| 143 |
grad_cam_image,
|
| 144 |
)
|
| 145 |
|
|
@@ -147,7 +148,8 @@ def predict_bone_age(Radiograph, Sex, Heatmap):
|
|
| 147 |
image = gr.Image(image_mode="L")
|
| 148 |
sex = gr.Radio(["Male", "Female"], type="index")
|
| 149 |
generate_heatmap = gr.Radio(["No", "Yes"], type="index")
|
| 150 |
-
|
|
|
|
| 151 |
grad_cam_image = gr.Image(image_mode="RGB", label="Heatmap / Image")
|
| 152 |
|
| 153 |
with gr.Blocks() as demo:
|
|
@@ -176,7 +178,7 @@ with gr.Blocks() as demo:
|
|
| 176 |
gr.Interface(
|
| 177 |
fn=predict_bone_age,
|
| 178 |
inputs=[image, sex, generate_heatmap],
|
| 179 |
-
outputs=[textbox, grad_cam_image],
|
| 180 |
examples=[
|
| 181 |
["examples/2639.png", "Female", "Yes"],
|
| 182 |
["examples/10043.png", "Female", "No"],
|
|
|
|
| 139 |
)
|
| 140 |
|
| 141 |
return (
|
| 142 |
+
bone_age_str,
|
| 143 |
+
f"The closest Greulich & Pyle bone ages are:\n 1) {closest1}\n 2) {closest2}",
|
| 144 |
grad_cam_image,
|
| 145 |
)
|
| 146 |
|
|
|
|
| 148 |
image = gr.Image(image_mode="L")
|
| 149 |
sex = gr.Radio(["Male", "Female"], type="index")
|
| 150 |
generate_heatmap = gr.Radio(["No", "Yes"], type="index")
|
| 151 |
+
label = gr.Label(show_label=False)
|
| 152 |
+
textbox = gr.Textbox(show_label=False)
|
| 153 |
grad_cam_image = gr.Image(image_mode="RGB", label="Heatmap / Image")
|
| 154 |
|
| 155 |
with gr.Blocks() as demo:
|
|
|
|
| 178 |
gr.Interface(
|
| 179 |
fn=predict_bone_age,
|
| 180 |
inputs=[image, sex, generate_heatmap],
|
| 181 |
+
outputs=[label, textbox, grad_cam_image],
|
| 182 |
examples=[
|
| 183 |
["examples/2639.png", "Female", "Yes"],
|
| 184 |
["examples/10043.png", "Female", "No"],
|