Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,13 +31,28 @@ def predict_image(image):
|
|
| 31 |
|
| 32 |
return predicted_class
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Gradio app interface
|
| 35 |
app = gr.Interface(
|
| 36 |
fn=predict_image,
|
| 37 |
inputs=gr.Image(type="numpy", label="Upload Image"),
|
| 38 |
outputs=gr.Textbox(label="Prediction"),
|
| 39 |
-
title=
|
| 40 |
-
description=
|
|
|
|
|
|
|
| 41 |
)
|
| 42 |
|
| 43 |
# Launch the app
|
|
|
|
| 31 |
|
| 32 |
return predicted_class
|
| 33 |
|
| 34 |
+
# HTML for custom styling
|
| 35 |
+
title = "<h1 style='text-align: center; font-family: Arial, sans-serif;'>Pox Classifier</h1>"
|
| 36 |
+
description = (
|
| 37 |
+
"<p style='text-align: center; font-family: Arial, sans-serif;'>"
|
| 38 |
+
"Upload an image of a skin lesion to classify it into one of the following categories:</p>"
|
| 39 |
+
"<p style='text-align: center; font-family: Arial, sans-serif; font-weight: bold;'>"
|
| 40 |
+
"Normal, Monkeypox, Chickenpox, Measles</p>"
|
| 41 |
+
"<p style='text-align: center; font-family: Arial, sans-serif;'>"
|
| 42 |
+
"Please note that this model is not a substitute for professional medical advice, diagnosis, or treatment. "
|
| 43 |
+
"Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition."
|
| 44 |
+
"</p>"
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
# Gradio app interface
|
| 48 |
app = gr.Interface(
|
| 49 |
fn=predict_image,
|
| 50 |
inputs=gr.Image(type="numpy", label="Upload Image"),
|
| 51 |
outputs=gr.Textbox(label="Prediction"),
|
| 52 |
+
title=title,
|
| 53 |
+
description=description,
|
| 54 |
+
theme="huggingface", # Apply Hugging Face's modern theme
|
| 55 |
+
layout="vertical" # Vertical layout to make it more compact and centered
|
| 56 |
)
|
| 57 |
|
| 58 |
# Launch the app
|