Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,8 +19,8 @@ def remove_background(image):
|
|
| 19 |
# Gradio Interface
|
| 20 |
iface = gr.Interface(
|
| 21 |
fn=remove_background,
|
| 22 |
-
inputs=gr.Image(label="Upload Image"),
|
| 23 |
-
outputs=gr.Image(label="Output Image"),
|
| 24 |
css="""
|
| 25 |
body {
|
| 26 |
font-family: 'Arial', sans-serif;
|
|
@@ -31,6 +31,9 @@ iface = gr.Interface(
|
|
| 31 |
.gradio-container {
|
| 32 |
background-color: #1a1a2e;
|
| 33 |
color: #ffffff;
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
.gr-button {
|
|
@@ -38,6 +41,7 @@ iface = gr.Interface(
|
|
| 38 |
color: white;
|
| 39 |
border: none;
|
| 40 |
border-radius: 4px;
|
|
|
|
| 41 |
}
|
| 42 |
|
| 43 |
.gr-button:hover {
|
|
@@ -55,41 +59,26 @@ iface = gr.Interface(
|
|
| 55 |
border-color: #6a6a7e;
|
| 56 |
}
|
| 57 |
|
| 58 |
-
.gr-file-upload {
|
| 59 |
-
background-color: #2a2a3e;
|
| 60 |
-
color: #ffffff;
|
| 61 |
-
}
|
| 62 |
-
|
| 63 |
-
.gr-slider {
|
| 64 |
-
background-color: #2a2a3e;
|
| 65 |
-
color: #ffffff;
|
| 66 |
-
}
|
| 67 |
-
|
| 68 |
-
.gr-dropdown {
|
| 69 |
-
background-color: #2a2a3e;
|
| 70 |
-
color: #ffffff;
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
.gr-image-preview {
|
| 74 |
border: 2px solid #4a4a5e;
|
| 75 |
background-color: #2a2a3e;
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
|
| 78 |
.gr-image-preview img {
|
| 79 |
-
|
| 80 |
height: auto;
|
|
|
|
|
|
|
| 81 |
object-fit: contain;
|
| 82 |
}
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
.gr-textbox:focus {
|
| 91 |
-
outline: none;
|
| 92 |
-
border-color: #6a6a7e;
|
| 93 |
}
|
| 94 |
""",
|
| 95 |
title="Background Remover",
|
|
|
|
| 19 |
# Gradio Interface
|
| 20 |
iface = gr.Interface(
|
| 21 |
fn=remove_background,
|
| 22 |
+
inputs=gr.Image(label="Upload Image", image_mode='RGB', shape=(30, 30)),
|
| 23 |
+
outputs=gr.Image(label="Output Image", type="pil", elem_id="output_image"),
|
| 24 |
css="""
|
| 25 |
body {
|
| 26 |
font-family: 'Arial', sans-serif;
|
|
|
|
| 31 |
.gradio-container {
|
| 32 |
background-color: #1a1a2e;
|
| 33 |
color: #ffffff;
|
| 34 |
+
display: flex;
|
| 35 |
+
flex-direction: column;
|
| 36 |
+
align-items: center;
|
| 37 |
}
|
| 38 |
|
| 39 |
.gr-button {
|
|
|
|
| 41 |
color: white;
|
| 42 |
border: none;
|
| 43 |
border-radius: 4px;
|
| 44 |
+
margin-top: 10px;
|
| 45 |
}
|
| 46 |
|
| 47 |
.gr-button:hover {
|
|
|
|
| 59 |
border-color: #6a6a7e;
|
| 60 |
}
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
.gr-image-preview {
|
| 63 |
border: 2px solid #4a4a5e;
|
| 64 |
background-color: #2a2a3e;
|
| 65 |
+
max-width: 300px;
|
| 66 |
+
max-height: 300px;
|
| 67 |
}
|
| 68 |
|
| 69 |
.gr-image-preview img {
|
| 70 |
+
width: 100%;
|
| 71 |
height: auto;
|
| 72 |
+
max-width: 300px;
|
| 73 |
+
max-height: 300px;
|
| 74 |
object-fit: contain;
|
| 75 |
}
|
| 76 |
|
| 77 |
+
#output_image {
|
| 78 |
+
max-width: 300px;
|
| 79 |
+
max-height: 300px;
|
| 80 |
+
width: 100%;
|
| 81 |
+
height: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
""",
|
| 84 |
title="Background Remover",
|