CharlieAmalet commited on
Commit
b772fd8
·
verified ·
1 Parent(s): e17d358

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -21,9 +21,8 @@ img {
21
  }
22
  """
23
 
24
- # DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
25
- DEVICE = 'cuda'
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
- device = "cuda" if torch.cuda.is_available() else "cpu"
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])