def create_context(cls: type, args: argparse.Namespace, cfg: CfgNode) -> Dict[str, Any]: vis_specs = args.visualizations.split(",") visualizers = [] extractors = [] for vis_spec in vis_specs: texture_atlas = get_texture_atlas(args.texture_atlas) texture_atlases_dict = get_texture_atlases( args.texture_atlases_map) vis = cls.VISUALIZERS[vis_spec]( cfg=cfg, texture_atlas=texture_atlas, texture_atlases_dict=texture_atlases_dict, ) visualizers.append(vis) extractor = create_extractor(vis) extractors.append(extractor) visualizer = CompoundVisualizer(visualizers) extractor = CompoundExtractor(extractors) context = { "extractor": extractor, "visualizer": visualizer, "out_fname": args.output, "entry_idx": 0, } return context
def prepare_context(vis_specs): print('prepare context with specs: ', vis_specs) visualizers = [] extractors = [] for vis_spec in vis_specs: vis = VISUALIZERS[vis_spec]() visualizers.append(vis) extractor = create_extractor(vis) extractors.append(extractor) visualizer = CompoundVisualizer(visualizers) extractor = CompoundExtractor(extractors) context = {"extractor": extractor, "visualizer": visualizer} return context
def create_context() -> Dict[str, Any]: vis_specs = ["dp_contour"] visualizers = [] extractors = [] for vis_spec in vis_specs: vis = VISUALIZERS[vis_spec]() visualizers.append(vis) extractor = create_extractor(vis) extractors.append(extractor) visualizer = CompoundVisualizer(visualizers) extractor = CompoundExtractor(extractors) context = { "extractor": extractor, "visualizer": visualizer, "entry_idx": 0, } return context
def create_context(cls: type, args: argparse.Namespace) -> Dict[str, Any]: vis_specs = args.visualizations.split(",") visualizers = [] extractors = [] for vis_spec in vis_specs: vis = cls.VISUALIZERS[vis_spec]() visualizers.append(vis) extractor = create_extractor(vis) extractors.append(extractor) visualizer = CompoundVisualizer(visualizers) extractor = CompoundExtractor(extractors) context = { "extractor": extractor, "visualizer": visualizer, "out_fname": args.output, "entry_idx": 0, } return context