Spaces:
Running
on
Zero
Running
on
Zero
wzhouxiff
commited on
Commit
•
4724339
1
Parent(s):
ed2f607
enable spaces
Browse files
app.py
CHANGED
@@ -160,7 +160,7 @@ pipeline = get_pipeline(model_id, "unet", model_config['down_block_types'], mode
|
|
160 |
# pipeline = None
|
161 |
|
162 |
### run the demo ##
|
163 |
-
|
164 |
def segment(canvas, image, logits):
|
165 |
if logits is not None:
|
166 |
logits *= 32.0
|
@@ -201,7 +201,7 @@ def segment(canvas, image, logits):
|
|
201 |
|
202 |
return mask[0], {'image': masked_img, 'points': points}, logits / 32.0
|
203 |
|
204 |
-
|
205 |
def run_objctrl_2_5d(condition_image,
|
206 |
mask,
|
207 |
depth,
|
@@ -488,7 +488,7 @@ def run_objctrl_2_5d(condition_image,
|
|
488 |
|
489 |
|
490 |
# UI function
|
491 |
-
|
492 |
def process_image(raw_image, trajectory_points):
|
493 |
|
494 |
image, points = raw_image['image'], raw_image['points']
|
@@ -544,7 +544,7 @@ def draw_points_on_image(img, points):
|
|
544 |
|
545 |
return img
|
546 |
|
547 |
-
|
548 |
def from_examples(raw_input, raw_image_points, canvas, seg_image_points, selected_points_text, camera_option, mask_bk):
|
549 |
|
550 |
selected_points = ast.literal_eval(selected_points_text)
|
|
|
160 |
# pipeline = None
|
161 |
|
162 |
### run the demo ##
|
163 |
+
@spaces.GPU(duration=5)
|
164 |
def segment(canvas, image, logits):
|
165 |
if logits is not None:
|
166 |
logits *= 32.0
|
|
|
201 |
|
202 |
return mask[0], {'image': masked_img, 'points': points}, logits / 32.0
|
203 |
|
204 |
+
@spaces.GPU(duration=80)
|
205 |
def run_objctrl_2_5d(condition_image,
|
206 |
mask,
|
207 |
depth,
|
|
|
488 |
|
489 |
|
490 |
# UI function
|
491 |
+
@spaces.GPU(duration=5)
|
492 |
def process_image(raw_image, trajectory_points):
|
493 |
|
494 |
image, points = raw_image['image'], raw_image['points']
|
|
|
544 |
|
545 |
return img
|
546 |
|
547 |
+
@spaces.GPU(duration=10)
|
548 |
def from_examples(raw_input, raw_image_points, canvas, seg_image_points, selected_points_text, camera_option, mask_bk):
|
549 |
|
550 |
selected_points = ast.literal_eval(selected_points_text)
|