Spaces:
Runtime error
Runtime error
Commit
·
4940ea7
1
Parent(s):
17ca5e5
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,23 +24,21 @@ def predict(image):
|
|
| 24 |
|
| 25 |
examples = [["benign.jpg"], ["malignant.jpg"]]
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
fn=predict,
|
| 31 |
-
inputs=gr.inputs.Image(shape=(150, 150)),
|
| 32 |
-
outputs=gr.outputs.Label(),
|
| 33 |
-
examples=examples,
|
| 34 |
-
title="Skin Cancer Classification",
|
| 35 |
-
description="Predicts whether a skin image is cancerous or not.",
|
| 36 |
-
theme="default", # Choose a theme: "default", "compact", "huggingface"
|
| 37 |
-
layout="vertical", # Choose a layout: "vertical", "horizontal", "double"
|
| 38 |
-
live=False # Set to True for live updates without clicking "Submit"
|
| 39 |
-
)
|
| 40 |
-
]
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
examples = [["benign.jpg"], ["malignant.jpg"]]
|
| 26 |
|
| 27 |
+
# Define input and output components
|
| 28 |
+
image_input = gr.inputs.Image(shape=(150, 150))
|
| 29 |
+
label_output = gr.outputs.Label()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
# Define a Gradio interface for user interaction
|
| 32 |
+
iface = gr.Interface(
|
| 33 |
+
fn=predict,
|
| 34 |
+
inputs=image_input,
|
| 35 |
+
outputs=label_output,
|
| 36 |
+
examples=examples,
|
| 37 |
+
title="Skin Cancer Classification",
|
| 38 |
+
description="Predicts whether a skin image is cancerous or not.",
|
| 39 |
+
theme="default", # Choose a theme: "default", "compact", "huggingface"
|
| 40 |
+
layout="vertical", # Choose a layout: "vertical", "horizontal", "double"
|
| 41 |
+
live=False # Set to True for live updates without clicking "Submit"
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
iface.launch()
|