Deadmon commited on
Commit
f847fa1
·
verified ·
1 Parent(s): 6245832

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -19
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", 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,9 +31,6 @@ iface = gr.Interface(
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,7 +38,6 @@ iface = gr.Interface(
41
  color: white;
42
  border: none;
43
  border-radius: 4px;
44
- margin-top: 10px;
45
  }
46
 
47
  .gr-button:hover {
@@ -52,6 +48,22 @@ iface = gr.Interface(
52
  background-color: #2a2a3e;
53
  color: #ffffff;
54
  border: 1px solid #4a4a5e;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  .gr-input:focus, .gr-output:focus {
@@ -59,30 +71,40 @@ iface = gr.Interface(
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",
85
  description="Upload an image to remove its background.",
 
86
  )
87
 
88
  if __name__ == "__main__":
 
19
  # Gradio Interface
20
  iface = gr.Interface(
21
  fn=remove_background,
22
+ inputs=gr.Image(label="Upload Image", image_mode='RGB', tool=None),
23
+ outputs=gr.Image(label="Output Image"),
24
  css="""
25
  body {
26
  font-family: 'Arial', sans-serif;
 
31
  .gradio-container {
32
  background-color: #1a1a2e;
33
  color: #ffffff;
 
 
 
34
  }
35
 
36
  .gr-button {
 
38
  color: white;
39
  border: none;
40
  border-radius: 4px;
 
41
  }
42
 
43
  .gr-button:hover {
 
48
  background-color: #2a2a3e;
49
  color: #ffffff;
50
  border: 1px solid #4a4a5e;
51
+ display: block;
52
+ margin: 0 auto;
53
+ }
54
+
55
+ .gr-input img {
56
+ width: 30px;
57
+ height: 30px;
58
+ object-fit: contain;
59
+ }
60
+
61
+ .gr-output img {
62
+ max-width: 300px;
63
+ max-height: 300px;
64
+ object-fit: contain;
65
+ display: block;
66
+ margin: 0 auto;
67
  }
68
 
69
  .gr-input:focus, .gr-output:focus {
 
71
  border-color: #6a6a7e;
72
  }
73
 
74
+ .gr-file-upload {
75
+ background-color: #2a2a3e;
76
+ color: #ffffff;
77
+ }
78
+
79
+ .gr-slider {
80
+ background-color: #2a2a3e;
81
+ color: #ffffff;
82
+ }
83
+
84
+ .gr-dropdown {
85
+ background-color: #2a2a3e;
86
+ color: #ffffff;
87
+ }
88
+
89
  .gr-image-preview {
90
  border: 2px solid #4a4a5e;
91
  background-color: #2a2a3e;
 
 
92
  }
93
 
94
+ .gr-textbox {
95
+ background-color: #2a2a3e;
96
+ color: #ffffff;
97
+ border: 1px solid #4a4a5e;
 
 
98
  }
99
 
100
+ .gr-textbox:focus {
101
+ outline: none;
102
+ border-color: #6a6a7e;
 
 
103
  }
104
  """,
105
  title="Background Remover",
106
  description="Upload an image to remove its background.",
107
+ layout="vertical"
108
  )
109
 
110
  if __name__ == "__main__":