Spaces:
Running
on
A10G
Running
on
A10G
byeongjun-park
commited on
Commit
·
b84546f
1
Parent(s):
b8eb5c1
HarmonyView update
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ class BackgroundRemoval:
|
|
66 |
return image
|
67 |
|
68 |
def resize_inputs(original_image, sam_image, crop_size, background_removal):
|
69 |
-
image_input = original_image if background_removal == "
|
70 |
if image_input is None: return None
|
71 |
alpha_np = np.asarray(image_input)[:, :, 3]
|
72 |
coords = np.stack(np.nonzero(alpha_np), 1)[:, (1, 0)]
|
@@ -193,7 +193,7 @@ def run_demo():
|
|
193 |
image_block = gr.Image(type='pil', image_mode='RGBA', height=256, label='Input image', tool=None, interactive=True)
|
194 |
elevation = gr.Slider(-10, 40, 30, step=5, label='Elevation angle of the input image', interactive=True)
|
195 |
crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
|
196 |
-
background_removal = gr.Radio(["
|
197 |
|
198 |
# Compose demo layout & data flow.
|
199 |
with gr.Blocks(title=_TITLE, css="hf_demo/style.css") as demo:
|
|
|
66 |
return image
|
67 |
|
68 |
def resize_inputs(original_image, sam_image, crop_size, background_removal):
|
69 |
+
image_input = original_image if background_removal == "Input Image" else sam_image
|
70 |
if image_input is None: return None
|
71 |
alpha_np = np.asarray(image_input)[:, :, 3]
|
72 |
coords = np.stack(np.nonzero(alpha_np), 1)[:, (1, 0)]
|
|
|
193 |
image_block = gr.Image(type='pil', image_mode='RGBA', height=256, label='Input image', tool=None, interactive=True)
|
194 |
elevation = gr.Slider(-10, 40, 30, step=5, label='Elevation angle of the input image', interactive=True)
|
195 |
crop_size = gr.Slider(120, 240, 200, step=10, label='Crop size', interactive=True)
|
196 |
+
background_removal = gr.Radio(["Input Image", "SAM Output"], value=["SAM Output"], label="Input to HarmonyView", info="Which image do you want for the input?")
|
197 |
|
198 |
# Compose demo layout & data flow.
|
199 |
with gr.Blocks(title=_TITLE, css="hf_demo/style.css") as demo:
|