ghostsInTheMachine commited on
Commit
1ba1ac4
·
verified ·
1 Parent(s): c36a9d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -105,6 +105,27 @@ def remove_background(image_ori):
105
  # Return images in the specified order
106
  return foreground, background, pred_pil, reverse_mask
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  iface = gr.Interface(
109
  fn=remove_background_wrapper,
110
  inputs=gr.Image(type="numpy"),
@@ -114,7 +135,8 @@ iface = gr.Interface(
114
  gr.Image(type="pil", label="Foreground Mask"),
115
  gr.Image(type="pil", label="Background Mask")
116
  ],
117
- allow_flagging="never"
 
118
  )
119
 
120
  if __name__ == "__main__":
 
105
  # Return images in the specified order
106
  return foreground, background, pred_pil, reverse_mask
107
 
108
+ # Custom CSS for button styling
109
+ custom_css = """
110
+ @keyframes gradient-animation {
111
+ 0% { background-position: 0% 50%; }
112
+ 50% { background-position: 100% 50%; }
113
+ 100% { background-position: 0% 50%; }
114
+ }
115
+
116
+ .gradio-container button {
117
+ background: linear-gradient(
118
+ 135deg,
119
+ #e0f7fa, #e8f5e9, #fff9c4, #ffebee,
120
+ #f3e5f5, #e1f5fe, #fff3e0, #e8eaf6
121
+ );
122
+ background-size: 400% 400%;
123
+ animation: gradient-animation 15s ease infinite;
124
+ border-radius: 12px;
125
+ color: white;
126
+ }
127
+ """
128
+
129
  iface = gr.Interface(
130
  fn=remove_background_wrapper,
131
  inputs=gr.Image(type="numpy"),
 
135
  gr.Image(type="pil", label="Foreground Mask"),
136
  gr.Image(type="pil", label="Background Mask")
137
  ],
138
+ allow_flagging="never",
139
+ css=custom_css # Apply custom CSS here
140
  )
141
 
142
  if __name__ == "__main__":