Spaces:
Running
on
Zero
Running
on
Zero
Update utils/gradio_utils.py
Browse files- utils/gradio_utils.py +13 -2
utils/gradio_utils.py
CHANGED
@@ -1,9 +1,20 @@
|
|
1 |
-
from ldm.util import
|
|
|
2 |
import spaces
|
3 |
|
4 |
|
5 |
def load_preprocess_model():
|
6 |
-
carvekit =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
return carvekit
|
8 |
|
9 |
@spaces.GPU
|
|
|
1 |
+
from ldm.util import load_and_preprocess
|
2 |
+
from carvekit.api.high import HiInterface
|
3 |
import spaces
|
4 |
|
5 |
|
6 |
def load_preprocess_model():
|
7 |
+
carvekit = HiInterface(object_type="object", # Can be "object" or "hairs-like".
|
8 |
+
batch_size_seg=5,
|
9 |
+
batch_size_matting=1,
|
10 |
+
# device='cuda' if torch.cuda.is_available() else 'cpu',
|
11 |
+
device='cuda',
|
12 |
+
seg_mask_size=640, # Use 640 for Tracer B7 and 320 for U2Net
|
13 |
+
matting_mask_size=2048,
|
14 |
+
trimap_prob_threshold=231,
|
15 |
+
trimap_dilation=30,
|
16 |
+
trimap_erosion_iters=5,
|
17 |
+
fp16=False)
|
18 |
return carvekit
|
19 |
|
20 |
@spaces.GPU
|