mtwohey2 commited on
Commit
6922ee3
·
verified ·
1 Parent(s): 878347e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -7,6 +7,7 @@ import numpy as np
7
  import matplotlib.cm as cm
8
  import matplotlib # New import for the updated colormap API
9
  import subprocess
 
10
 
11
  from video_depth_anything.video_depth import VideoDepthAnything
12
  from utils.dc_utils import read_video_frames, save_video
@@ -31,8 +32,11 @@ examples = [
31
  ['assets/example_videos/sheep_cut1.mp4', -1, -1, 1280, True, True, True, 0.3],
32
  ]
33
 
34
- # Use GPU if available; otherwise, use CPU.
35
- DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
 
 
 
36
 
37
  # Model configuration for different encoder variants.
38
  model_configs = {
 
7
  import matplotlib.cm as cm
8
  import matplotlib # New import for the updated colormap API
9
  import subprocess
10
+ import sys
11
 
12
  from video_depth_anything.video_depth import VideoDepthAnything
13
  from utils.dc_utils import read_video_frames, save_video
 
32
  ['assets/example_videos/sheep_cut1.mp4', -1, -1, 1280, True, True, True, 0.3],
33
  ]
34
 
35
+ if not torch.cuda.is_available():
36
+ sys.exit("CUDA is not available. Exiting...")
37
+
38
+ DEVICE = 'cuda'
39
+ print(f"Using device: {DEVICE}")
40
 
41
  # Model configuration for different encoder variants.
42
  model_configs = {