def augment_args()

in tools/make_video.py [0:0]


def augment_args(args):
    if args.video3d_dir is not None:
        args.color_dir = pjoin(args.video3d_dir, args.color_dir)
        args.depth_dirs = [pjoin(args.video3d_dir, dir) for dir in args.depth_dirs]
        args.out_dir = pjoin(args.video3d_dir, args.out_dir)

    # depth_dir can include or omit the "depth" suffix
    # number of frames should be equal
    frame_ext = os.path.splitext(args.frame_fmt)[-1]
    n = num_frames(args.color_dir, frame_ext)
    assert n > 0

    DEPTH = "depth"
    args.depth_names = []
    valid_depth_dirs = []
    for depth_dir in args.depth_dirs:
        names = os.listdir(depth_dir)
        if DEPTH in names and len(names) == 1:
            depth_dir = pjoin(depth_dir, DEPTH)

        depth_frames = num_frames(depth_dir, frame_ext)
        if depth_frames == n:
            valid_depth_dirs.append(depth_dir)
        else:
            logging.warning("[Warning] %d vs. %d in %s" % (depth_frames, n, depth_dir))
            continue

        p_head, p_tail = os.path.split(depth_dir)
        if p_tail == DEPTH:
            p_head, p_tail = os.path.split(p_head)
        args.depth_names.append(p_tail)
    args.depth_dirs = valid_depth_dirs
    return args