Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
from transparent_background import Remover
|
| 4 |
from PIL import Image
|
|
@@ -19,47 +18,30 @@ iface = gr.Interface(
|
|
| 19 |
fn=remove_background,
|
| 20 |
inputs=gr.Image(label="Upload Image"),
|
| 21 |
outputs=gr.Image(label="Output Image"),
|
| 22 |
-
live=True,
|
| 23 |
-
css="""
|
| 24 |
-
.gradio-container {
|
| 25 |
-
background-color: #f0f0f0;
|
| 26 |
-
font-family: Arial, sans-serif;
|
| 27 |
-
}
|
| 28 |
-
.gr-inputs, .gr-outputs {
|
| 29 |
-
display: flex;
|
| 30 |
-
flex-direction: column;
|
| 31 |
-
align-items: center;
|
| 32 |
-
}
|
| 33 |
-
.gr-button {
|
| 34 |
-
margin-top: 20px;
|
| 35 |
-
background-color: #4CAF50;
|
| 36 |
-
color: white;
|
| 37 |
-
border: none;
|
| 38 |
-
padding: 10px 20px;
|
| 39 |
-
text-align: center;
|
| 40 |
-
font-size: 16px;
|
| 41 |
-
border-radius: 5px;
|
| 42 |
-
transition: background-color 0.3s;
|
| 43 |
-
}
|
| 44 |
-
.gr-button:hover {
|
| 45 |
-
background-color: #45a049;
|
| 46 |
-
}
|
| 47 |
-
.gr-button-container {
|
| 48 |
-
display: flex;
|
| 49 |
-
justify-content: space-between;
|
| 50 |
-
width: 100%;
|
| 51 |
-
max-width: 300px;
|
| 52 |
-
margin-top: 20px;
|
| 53 |
-
}
|
| 54 |
-
""",
|
| 55 |
layout="vertical",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
)
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
outputs=[gr.Image(label="Output Image")],
|
| 61 |
-
layout="vertical",
|
| 62 |
-
live=False,
|
| 63 |
-
show_submit_button=True,
|
| 64 |
-
show_clear_button=True,
|
| 65 |
-
)
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transparent_background import Remover
|
| 3 |
from PIL import Image
|
|
|
|
| 18 |
fn=remove_background,
|
| 19 |
inputs=gr.Image(label="Upload Image"),
|
| 20 |
outputs=gr.Image(label="Output Image"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
layout="vertical",
|
| 22 |
+
css="""
|
| 23 |
+
.container { margin-top: 0px !important; }
|
| 24 |
+
.input_image, .output_image {
|
| 25 |
+
display: flex;
|
| 26 |
+
justify-content: center;
|
| 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: 8px;
|
| 42 |
+
}
|
| 43 |
+
"""
|
| 44 |
)
|
| 45 |
|
| 46 |
+
if __name__ == "__main__":
|
| 47 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|