Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
0eb90c8
1
Parent(s):
973c0b5
hf cuda issue
Browse files
app.py
CHANGED
@@ -663,7 +663,8 @@ def ready_sample(img_cropped, img_original, ex_mask, inpaint_mask, keypts, keypt
|
|
663 |
img = cv2.resize(img_cropped["background"][..., :3], opts.image_size, interpolation=cv2.INTER_AREA)
|
664 |
else:
|
665 |
img = cv2.resize(img_original[..., :3], opts.image_size, interpolation=cv2.INTER_AREA)
|
666 |
-
sam_predictor
|
|
|
667 |
if keypts is None and keypts_np is not None:
|
668 |
keypts = keypts_np
|
669 |
else:
|
|
|
663 |
img = cv2.resize(img_cropped["background"][..., :3], opts.image_size, interpolation=cv2.INTER_AREA)
|
664 |
else:
|
665 |
img = cv2.resize(img_original[..., :3], opts.image_size, interpolation=cv2.INTER_AREA)
|
666 |
+
sam_predictor = init_sam(ckpt_path=sam_path, device="cuda")
|
667 |
+
sam_predictor.set_image(img)
|
668 |
if keypts is None and keypts_np is not None:
|
669 |
keypts = keypts_np
|
670 |
else:
|