Spaces:
Runtime error
Runtime error
Update core/process.py
Browse files- core/process.py +2 -2
core/process.py
CHANGED
|
@@ -93,7 +93,7 @@ def process_image(
|
|
| 93 |
if run_seg:
|
| 94 |
logger.info(f"Running segmentation with model: {seg_model}")
|
| 95 |
load_start = time.time()
|
| 96 |
-
model = get_model("segmentation",
|
| 97 |
logger.info(f"{seg_model} segmentation model loaded in {time.time() - load_start:.2f} seconds.")
|
| 98 |
mask = model.predict(image)
|
| 99 |
overlay = model.draw(image, mask, alpha=blend)
|
|
@@ -107,7 +107,7 @@ def process_image(
|
|
| 107 |
if run_depth:
|
| 108 |
logger.info(f"Running depth estimation with model: {depth_model}")
|
| 109 |
load_start = time.time()
|
| 110 |
-
model = get_model("depth",
|
| 111 |
logger.info(f"{depth_model} depth model loaded in {time.time() - load_start:.2f} seconds.")
|
| 112 |
dmap = model.predict(image)
|
| 113 |
norm_dmap = ((dmap - dmap.min()) / (dmap.ptp()) * 255).astype(np.uint8)
|
|
|
|
| 93 |
if run_seg:
|
| 94 |
logger.info(f"Running segmentation with model: {seg_model}")
|
| 95 |
load_start = time.time()
|
| 96 |
+
model = get_model("segmentation", seg_model, device="cpu")
|
| 97 |
logger.info(f"{seg_model} segmentation model loaded in {time.time() - load_start:.2f} seconds.")
|
| 98 |
mask = model.predict(image)
|
| 99 |
overlay = model.draw(image, mask, alpha=blend)
|
|
|
|
| 107 |
if run_depth:
|
| 108 |
logger.info(f"Running depth estimation with model: {depth_model}")
|
| 109 |
load_start = time.time()
|
| 110 |
+
model = get_model("depth", depth_model, device="cpu")
|
| 111 |
logger.info(f"{depth_model} depth model loaded in {time.time() - load_start:.2f} seconds.")
|
| 112 |
dmap = model.predict(image)
|
| 113 |
norm_dmap = ((dmap - dmap.min()) / (dmap.ptp()) * 255).astype(np.uint8)
|