Add application file
Browse files
app.py
CHANGED
|
@@ -17,11 +17,52 @@ def analyze_image_direct(image, question):
|
|
| 17 |
|
| 18 |
# Define custom CSS to make the interface purple
|
| 19 |
custom_css = """
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
"""
|
| 24 |
|
|
|
|
| 25 |
# Create Gradio interface with custom CSS for a purple theme
|
| 26 |
iface = gr.Interface(fn=analyze_image_direct,
|
| 27 |
inputs=[gr.Image(type="pil"), gr.Textbox(lines=2, placeholder="Enter your question here...")],
|
|
|
|
| 17 |
|
| 18 |
# Define custom CSS to make the interface purple
|
| 19 |
custom_css = """
|
| 20 |
+
/* General background */
|
| 21 |
+
body {
|
| 22 |
+
background-color: #6a0dad; /* Rich purple background */
|
| 23 |
+
color: #EDE7F6; /* Light purple text for contrast */
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/* Buttons */
|
| 27 |
+
button {
|
| 28 |
+
background-color: #9c27b0; /* Vibrant purple */
|
| 29 |
+
color: #FFFFFF; /* White text */
|
| 30 |
+
border: none;
|
| 31 |
+
border-radius: 5px; /* Rounded corners for buttons */
|
| 32 |
+
padding: 10px 20px;
|
| 33 |
+
cursor: pointer;
|
| 34 |
+
transition: background-color 0.3s ease;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
button:hover {
|
| 38 |
+
background-color: #7b1fa2; /* Darker purple on hover */
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/* Text inputs and text areas */
|
| 42 |
+
input[type="text"], textarea {
|
| 43 |
+
background-color: #9575cd; /* Soft purple */
|
| 44 |
+
color: #FFFFFF; /* White text */
|
| 45 |
+
border: none;
|
| 46 |
+
padding: 10px;
|
| 47 |
+
border-radius: 5px; /* Rounded corners for text inputs */
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/* Gradio interface container for a more centered look */
|
| 51 |
+
.gradio_container {
|
| 52 |
+
max-width: 800px; /* Adjust based on preference */
|
| 53 |
+
margin: auto;
|
| 54 |
+
padding: 20px;
|
| 55 |
+
border-radius: 10px;
|
| 56 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* Titles and descriptions */
|
| 60 |
+
h1, h2, h3, p {
|
| 61 |
+
color: #EDE7F6; /* Light purple text for readability */
|
| 62 |
+
}
|
| 63 |
"""
|
| 64 |
|
| 65 |
+
|
| 66 |
# Create Gradio interface with custom CSS for a purple theme
|
| 67 |
iface = gr.Interface(fn=analyze_image_direct,
|
| 68 |
inputs=[gr.Image(type="pil"), gr.Textbox(lines=2, placeholder="Enter your question here...")],
|