Spaces:
Build error
Build error
Update app.py
Browse files
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=
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|