Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,6 +49,16 @@ def predict_anime_character(img, model_type):
|
|
| 49 |
except Exception as e:
|
| 50 |
return {"error": str(e)}
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# Define the Gradio interface
|
| 53 |
interface = gr.Interface(
|
| 54 |
fn=predict_anime_character,
|
|
@@ -58,7 +68,8 @@ interface = gr.Interface(
|
|
| 58 |
],
|
| 59 |
outputs=gr.Label(num_top_classes=5, label="Prediction"),
|
| 60 |
title="Anime Character Classifier",
|
| 61 |
-
description="Upload an image of an anime character and the classifier will predict its character."
|
|
|
|
| 62 |
)
|
| 63 |
|
| 64 |
# Launch the interface
|
|
|
|
| 49 |
except Exception as e:
|
| 50 |
return {"error": str(e)}
|
| 51 |
|
| 52 |
+
# Custom CSS for Dark Mode and Elegant Design
|
| 53 |
+
custom_css = """
|
| 54 |
+
body {background-color: #121212; color: #e0e0e0; font-family: 'Arial', sans-serif;}
|
| 55 |
+
h1 {color: #ff5722;}
|
| 56 |
+
label {color: #ff9800;}
|
| 57 |
+
input[type=radio] {accent-color: #ff5722;}
|
| 58 |
+
button:hover {background-color: #e64a19;}
|
| 59 |
+
.footer {display: none !important;}
|
| 60 |
+
"""
|
| 61 |
+
|
| 62 |
# Define the Gradio interface
|
| 63 |
interface = gr.Interface(
|
| 64 |
fn=predict_anime_character,
|
|
|
|
| 68 |
],
|
| 69 |
outputs=gr.Label(num_top_classes=5, label="Prediction"),
|
| 70 |
title="Anime Character Classifier",
|
| 71 |
+
description="Upload an image of an anime character and the classifier will predict its character.",
|
| 72 |
+
css=custom_css # Apply the custom CSS
|
| 73 |
)
|
| 74 |
|
| 75 |
# Launch the interface
|