mcrlc commited on
Commit
c24b6f9
1 Parent(s): e9c53c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -123,7 +123,7 @@ hypar["model"] = ISNetDIS()
123
  net = build_model(hypar, device)
124
 
125
 
126
- def inference(image: Image):
127
  image_path = image
128
 
129
  image_tensor, orig_size = load_image(image_path, hypar)
@@ -151,8 +151,14 @@ article = "<div><center><img src='https://visitor-badge.glitch.me/badge?page_id=
151
 
152
  interface = gr.Interface(
153
  fn=inference,
154
- inputs=gr.Image(type='filepath'),
155
- outputs=["image", "image"],
 
 
 
 
 
 
156
  examples=[['robot.png'], ['ship.png']],
157
  title=title,
158
  description=description,
 
123
  net = build_model(hypar, device)
124
 
125
 
126
+ def inference(image: Image, color: str):
127
  image_path = image
128
 
129
  image_tensor, orig_size = load_image(image_path, hypar)
 
151
 
152
  interface = gr.Interface(
153
  fn=inference,
154
+ inputs=[
155
+ gr.Image(type='filepath', label="Image"),
156
+ gr.ColorPicker(label="Background Color", value="0x00C49A")
157
+ ],
158
+ outputs=[
159
+ gr.Image(label="Full Background"),
160
+ gr.Image(label="Transparent Background")
161
+ ],
162
  examples=[['robot.png'], ['ship.png']],
163
  title=title,
164
  description=description,