Update utils/dc_utils.py
Browse files70 unmodified lines717273747576771 unmodified line7980818283848570 unmodified linesreturn frames, fpsdef save_video(frames, output_video_path, fps=10, is_depths=False):writer = imageio.get_writer(output_video_path, fps=fps, macro_block_size=1, codec='libx264', ffmpeg_params=['-crf', '18'])if is_depths:colormap = np.array(cm.get_cmap("inferno").colors)1 unmodified linefor i in range(frames.shape[0]):depth = frames[i]depth_norm = ((depth - d_min) / (d_max - d_min) * 255).astype(np.uint8)depth_vis = (colormap[depth_norm] * 255).astype(np.uint8)writer.append_data(depth_vis)else:for i in range(frames.shape[0]):70 unmodified lines717273747576771 unmodified line7980818283848570 unmodified linesreturn frames, fpsdef save_video(frames, output_video_path, fps=10, is_depths=False, grayscale=False):writer = imageio.get_writer(output_video_path, fps=fps, macro_block_size=1, codec='libx264', ffmpeg_params=['-crf', '18'])if is_depths:colormap = np.array(cm.get_cmap("inferno").colors)1 unmodified linefor i in range(frames.shape[0]):depth = frames[i]depth_norm = ((depth - d_min) / (d_max - d_min) * 255).astype(np.uint8)depth_vis = (colormap[depth_norm] * 255).astype(np.uint8) if not grayscale else depth_normwriter.append_data(depth_vis)else:for i in range(frames.shape[0]):
utils/dc_utils.py+2-2