JohanDL commited on
Commit
3f4959e
1 Parent(s): 42313b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -18,6 +18,8 @@ def predict_depth(model, image):
18
  return model(image)
19
 
20
  def make_video(video_path, outdir='./vis_video_depth',encoder='vitl'):
 
 
21
  # DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
22
  # model = DepthAnything.from_pretrained('LiheYoung/depth_anything_vitl14').to(DEVICE).eval()
23
  # Define path for temporary processed frames
@@ -149,7 +151,7 @@ with gr.Blocks(css=css) as demo:
149
 
150
  with gr.Row():
151
  input_video = gr.Video(label="Input Video")
152
- model_type = gr.Dropdown(["vits", "vitl"], type="value", label='Model Type')
153
  submit = gr.Button("Submit")
154
  processed_video = gr.Video(label="Processed Video")
155
 
 
18
  return model(image)
19
 
20
  def make_video(video_path, outdir='./vis_video_depth',encoder='vitl'):
21
+ if encoder not in ["vitl","vitb","vits"]:
22
+ encoder = "vitl"
23
  # DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
24
  # model = DepthAnything.from_pretrained('LiheYoung/depth_anything_vitl14').to(DEVICE).eval()
25
  # Define path for temporary processed frames
 
151
 
152
  with gr.Row():
153
  input_video = gr.Video(label="Input Video")
154
+ model_type = gr.Dropdown(["vits", "vitb", "vitl"], type="value", label='Model Type')
155
  submit = gr.Button("Submit")
156
  processed_video = gr.Video(label="Processed Video")
157