haotongl commited on
Commit
6af69a0
·
1 Parent(s): 46f9f7c

inital version

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -18,7 +18,10 @@ import imageio
18
  from promptda.promptda import PromptDA
19
  from promptda.utils.io_wrapper import load_image, load_depth
20
  from promptda.utils.depth_utils import visualize_depth, unproject_depth
21
- model = PromptDA.from_pretrained('depth-anything/promptda_vitl').to("cuda").eval()
 
 
 
22
  thread_pool_executor = ThreadPoolExecutor(max_workers=1)
23
 
24
  def delete_later(path: Union[str, os.PathLike], delay: int = 300):
 
18
  from promptda.promptda import PromptDA
19
  from promptda.utils.io_wrapper import load_image, load_depth
20
  from promptda.utils.depth_utils import visualize_depth, unproject_depth
21
+ import torch
22
+ DEVICE = 'cuda' if torch.cuda.is_available(
23
+ ) else 'mps' if torch.backends.mps.is_available() else 'cpu'
24
+ model = PromptDA.from_pretrained('depth-anything/promptda_vitl').to(DEVICE).eval()
25
  thread_pool_executor = ThreadPoolExecutor(max_workers=1)
26
 
27
  def delete_later(path: Union[str, os.PathLike], delay: int = 300):