Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ from transparent_background import Remover
|
|
| 4 |
from PIL import Image
|
| 5 |
import numpy as np
|
| 6 |
|
| 7 |
-
|
| 8 |
def remove_background(image):
|
| 9 |
remover = Remover()
|
| 10 |
if isinstance(image, Image.Image):
|
|
@@ -20,8 +19,32 @@ iface = gr.Interface(
|
|
| 20 |
fn=remove_background,
|
| 21 |
inputs=gr.Image(label="Upload Image"),
|
| 22 |
outputs=gr.Image(label="Output Image"),
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
)
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import numpy as np
|
| 6 |
|
|
|
|
| 7 |
def remove_background(image):
|
| 8 |
remover = Remover()
|
| 9 |
if isinstance(image, Image.Image):
|
|
|
|
| 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 |
+
"""
|
| 48 |
)
|
| 49 |
|
| 50 |
if __name__ == "__main__":
|