def main(): # Use first line of file docstring as description if it exists. parser = argparse.ArgumentParser( description=__doc__.split('\n')[0] if __doc__ else '', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--config', default=Path('./release/config.yaml')) parser.add_argument('--frames-dir', type=Path, required=True) parser.add_argument('--output-dir', type=Path, required=True) parser.add_argument('--extensions', nargs='*', default=IMG_EXTENSIONS) args = parser.parse_args() with open(args.config, 'r') as f: config = yaml.load(f) args.output_dir.mkdir(exist_ok=True, parents=True) common_setup(__file__, args.output_dir) logging.debug('Args:\n%s', pprint.pformat(vars(args))) logging.debug('Config:\n%s', pprint.pformat(config)) msg(f"Computing flow on {args.frames_dir}.") compute_flow_helper(config, args.frames_dir, args.output_dir, extensions=args.extensions, recursive=True)
def main(): # Use first line of file docstring as description if it exists. parser = argparse.ArgumentParser( description=__doc__.split('\n')[0] if __doc__ else '', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--config', default=Path('./release/config.yaml')) args = parser.parse_args() with open(args.config, 'r') as f: config = yaml.load(f) output_root = Path(config['davis16']['output_dir']) flow_output = output_root / 'flow' flow_output.mkdir(exist_ok=True, parents=True) common_setup(__file__, flow_output, args) logging.debug('Config:\n%s', pprint.pformat(config)) split_dirs = link_splits(config) for split in config['davis16']['splits']: input_dir = split_dirs[split][0] output_split = flow_output / split msg("Computing flow on DAVIS 2016 %s set.") compute_flow_helper(config, input_dir, output_split, extensions=['.jpg'])
def main(): # Use first line of file docstring as description if it exists. parser = argparse.ArgumentParser( description=__doc__.split('\n')[0] if __doc__ else '', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--config', default=Path('./release/config.yaml')) args = parser.parse_args() with open(args.config, 'r') as f: config = yaml.load(f) output_dir = Path(config['fbms']['output_dir']) / 'flow' output_dir.mkdir(exist_ok=True, parents=True) common_setup(__file__, output_dir, args) logging.debug('Config:\n%s', pprint.pformat(config)) for split in config['fbms']['splits']: input_dir = config['fbms']['images_highres'][split] output_split = output_dir / split logging.info("\n\n###\n" "Computing flow on FBMS %s set.\n" "###\n\n", split) compute_flow_helper(config, input_dir, output_split, extensions=['.png'])