Spaces:
Running
on
Zero
Running
on
Zero
CharlieAmalet
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -21,9 +21,8 @@ img {
|
|
21 |
}
|
22 |
"""
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to("cpu").eval()
|
27 |
|
28 |
CHECKPOINT = "prs-eth/marigold-v1-0"
|
29 |
pipe = MarigoldPipeline.from_pretrained(CHECKPOINT)
|
@@ -45,8 +44,7 @@ def process_image(image: Image.Image):
|
|
45 |
global model
|
46 |
image = image.convert("RGB")
|
47 |
|
48 |
-
|
49 |
-
model.to(device)
|
50 |
depth = model.infer_pil(image)
|
51 |
|
52 |
processed_array = save_raw_16bit(colorize(depth)[:, :, 0])
|
|
|
21 |
}
|
22 |
"""
|
23 |
|
24 |
+
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
25 |
+
model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to(DEVICE).eval()
|
|
|
26 |
|
27 |
CHECKPOINT = "prs-eth/marigold-v1-0"
|
28 |
pipe = MarigoldPipeline.from_pretrained(CHECKPOINT)
|
|
|
44 |
global model
|
45 |
image = image.convert("RGB")
|
46 |
|
47 |
+
# model.to(DEVICE)
|
|
|
48 |
depth = model.infer_pil(image)
|
49 |
|
50 |
processed_array = save_raw_16bit(colorize(depth)[:, :, 0])
|