コード例 #1
0
ファイル: apply_net.py プロジェクト: zetyquickly/DensePoseFnL
 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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
ファイル: apply_net.py プロジェクト: charliememory/detectron2
 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