Spaces:
Running
on
Zero
Running
on
Zero
Update app_3.py
Browse files
app_3.py
CHANGED
@@ -465,8 +465,8 @@ def resize_without_crop(image, target_width, target_height):
|
|
465 |
resized_image = pil_image.resize((target_width, target_height), Image.LANCZOS)
|
466 |
return np.array(resized_image)
|
467 |
|
468 |
-
@spaces.GPU(duration=60)
|
469 |
-
@torch.inference_mode()
|
470 |
# def run_rmbg(img, sigma=0.0):
|
471 |
# # Convert RGBA to RGB if needed
|
472 |
# if img.shape[-1] == 4:
|
@@ -1196,7 +1196,7 @@ with block:
|
|
1196 |
with gr.Row():
|
1197 |
with gr.Column():
|
1198 |
with gr.Row():
|
1199 |
-
input_fg = gr.Image(type="
|
1200 |
with gr.Row():
|
1201 |
with gr.Group():
|
1202 |
find_objects_button = gr.Button(value="(Option 1) Segment Object from text")
|
@@ -1208,7 +1208,7 @@ with block:
|
|
1208 |
extract_button = gr.Button(value="Remove Background")
|
1209 |
with gr.Row():
|
1210 |
extracted_objects = gr.Image(type="numpy", label="Extracted Foreground", height=480)
|
1211 |
-
extracted_fg = gr.Image(type="
|
1212 |
angles_fg = gr.Image(type="pil", label="Converted Foreground", height=480, visible=False)
|
1213 |
|
1214 |
with gr.Row():
|
|
|
465 |
resized_image = pil_image.resize((target_width, target_height), Image.LANCZOS)
|
466 |
return np.array(resized_image)
|
467 |
|
468 |
+
# @spaces.GPU(duration=60)
|
469 |
+
# @torch.inference_mode()
|
470 |
# def run_rmbg(img, sigma=0.0):
|
471 |
# # Convert RGBA to RGB if needed
|
472 |
# if img.shape[-1] == 4:
|
|
|
1196 |
with gr.Row():
|
1197 |
with gr.Column():
|
1198 |
with gr.Row():
|
1199 |
+
input_fg = gr.Image(type="pil", label="Image", height=480)
|
1200 |
with gr.Row():
|
1201 |
with gr.Group():
|
1202 |
find_objects_button = gr.Button(value="(Option 1) Segment Object from text")
|
|
|
1208 |
extract_button = gr.Button(value="Remove Background")
|
1209 |
with gr.Row():
|
1210 |
extracted_objects = gr.Image(type="numpy", label="Extracted Foreground", height=480)
|
1211 |
+
extracted_fg = gr.Image(type="pil", label="Extracted Foreground", height=480)
|
1212 |
angles_fg = gr.Image(type="pil", label="Converted Foreground", height=480, visible=False)
|
1213 |
|
1214 |
with gr.Row():
|