Update app.py
Browse files
app.py
CHANGED
|
@@ -14,34 +14,37 @@ def remove_background(image):
|
|
| 14 |
raise TypeError("Unsupported image type")
|
| 15 |
return output
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
css="""
|
| 23 |
-
.container { margin-top: 0px !important; }
|
| 24 |
.input_image, .output_image {
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
align-items: center;
|
| 28 |
-
margin: 10px 0;
|
| 29 |
}
|
| 30 |
-
.button {
|
| 31 |
background-color: #4CAF50;
|
| 32 |
color: white;
|
| 33 |
border: none;
|
| 34 |
padding: 10px 20px;
|
| 35 |
text-align: center;
|
| 36 |
-
text-decoration: none;
|
| 37 |
-
display: inline-block;
|
| 38 |
font-size: 16px;
|
| 39 |
-
margin: 4px 2px;
|
| 40 |
cursor: pointer;
|
| 41 |
-
border-radius:
|
|
|
|
| 42 |
}
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
)
|
| 45 |
|
| 46 |
-
|
| 47 |
-
iface.launch()
|
|
|
|
| 14 |
raise TypeError("Unsupported image type")
|
| 15 |
return output
|
| 16 |
|
| 17 |
+
css = """
|
| 18 |
+
body {
|
| 19 |
+
background-color: #f5f5f5;
|
| 20 |
+
font-family: Arial, sans-serif;
|
| 21 |
+
}
|
|
|
|
|
|
|
| 22 |
.input_image, .output_image {
|
| 23 |
+
border-radius: 10px;
|
| 24 |
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
+
.gr-button {
|
| 27 |
background-color: #4CAF50;
|
| 28 |
color: white;
|
| 29 |
border: none;
|
| 30 |
padding: 10px 20px;
|
| 31 |
text-align: center;
|
|
|
|
|
|
|
| 32 |
font-size: 16px;
|
|
|
|
| 33 |
cursor: pointer;
|
| 34 |
+
border-radius: 5px;
|
| 35 |
+
margin: 4px 2px;
|
| 36 |
}
|
| 37 |
+
.gr-button:hover {
|
| 38 |
+
background-color: #45a049;
|
| 39 |
+
}
|
| 40 |
+
"""
|
| 41 |
+
|
| 42 |
+
iface = gr.Interface(
|
| 43 |
+
fn=remove_background,
|
| 44 |
+
inputs=gr.Image(label="Upload Image", css_class="input_image"),
|
| 45 |
+
outputs=gr.Image(label="Output Image", css_class="output_image"),
|
| 46 |
+
live=True,
|
| 47 |
+
css=css
|
| 48 |
)
|
| 49 |
|
| 50 |
+
iface.launch()
|
|
|