Update video_depth_anything/video_depth.py
Browse files63 unmodified lines6465666768697024 unmodified lines959697989910010163 unmodified linesdepth = F.relu(depth)return depth.squeeze(1).unflatten(0, (B, T)) # return shape [B, T, H, W]def infer_video_depth(self, frames, target_fps, input_size=518, device='cuda'):frame_height, frame_width = frames[0].shape[:2]ratio = max(frame_height, frame_width) / min(frame_height, frame_width)if ratio > 1.78:24 unmodified linesdepth_list = []pre_input = Nonefor frame_id in tqdm(range(0, org_video_len, frame_step)):cur_list = []for i in range(INFER_LEN):cur_list.append(torch.from_numpy(transform({'image': frame_list[frame_id+i].astype(np.float32) / 255.0})['image']).unsqueeze(0).unsqueeze(0))63 unmodified lines6465666768697024 unmodified lines959697989910010163 unmodified linesdepth = F.relu(depth)return depth.squeeze(1).unflatten(0, (B, T)) # return shape [B, T, H, W]def infer_video_depth(self, frames, target_fps, input_size=518, device='cuda', progress=tqdm):frame_height, frame_width = frames[0].shape[:2]ratio = max(frame_height, frame_width) / min(frame_height, frame_width)if ratio > 1.78:24 unmodified linesdepth_list = []pre_input = Nonefor frame_id in progress(range(0, org_video_len, frame_step)):cur_list = []for i in range(INFER_LEN):cur_list.append(torch.from_numpy(transform({'image': frame_list[frame_id+i].astype(np.float32) / 255.0})['image']).unsqueeze(0).unsqueeze(0))
video_depth_anything/video_depth.py+2-2