Exemple #1
0
    def __init__(self, cfg):
        super(AnyNet, self).__init__()
        self.cfg = cfg.copy()
        self.max_disp = cfg.model.max_disp
        self.stage = cfg.model.stage

        self.backbone = build_backbone(cfg)

        self.cost_processor = build_cost_processor(cfg)

        # disparity predictor
        self.disp_predictor = nn.ModuleDict()
        for st in self.stage:
            self.disp_predictor[st] = FasterSoftArgmin(
                max_disp=cfg.model.disp_predictor.max_disp[st],
                start_disp=cfg.model.disp_predictor.start_disp[st],
                dilation=cfg.model.disp_predictor.dilation[st],
                alpha=cfg.model.disp_predictor.alpha,
                normalize=cfg.model.disp_predictor.normalize,
            )

        self.disp_refinement = build_disp_refinement(cfg)

        # make general stereo matching loss evaluator
        self.loss_evaluator = make_gsm_loss_evaluator(cfg)
    def setUpClass(cls):
        cls.device = torch.device('cuda:7')
        config_path = '/home/zhixiang/youmin/projects/depth/public/' \
                      'DenseMatchingBenchmark/configs/AnyNet/scene_flow.py'
        cls.cfg = Config.fromfile(config_path)
        cls.backbone = build_backbone(cls.cfg)
        cls.backbone.to(cls.device)

        cls.setUpTimeTestingClass()
        cls.avg_time = {}
Exemple #3
0
    def __init__(self, cfg):
        super(DeepPruner, self).__init__()
        self.cfg = cfg.copy()
        self.max_disp = cfg.model.max_disp

        self.backbone = build_backbone(cfg)

        self.disp_sampler = build_disp_sampler(cfg)

        self.cost_processor = build_cost_processor(cfg)

        self.disp_refinement = build_disp_refinement(cfg)

        # make general stereo matching loss evaluator
        self.loss_evaluator = make_gsm_loss_evaluator(cfg)
    def __init__(self, cfg):
        super(GeneralizedStereoModel, self).__init__()
        self.cfg = cfg.copy()
        self.max_disp = cfg.model.max_disp
        self.scale = cfg.model.backbone.scale

        self.backbone = build_backbone(cfg)
        self.cost_processor = build_cost_processor(cfg)

        # confidence measurement network
        self.cmn = None
        if 'cmn' in cfg.model:
            self.cmn = build_cmn(cfg)

        self.disp_predictor = build_disp_predictor(cfg)
        self.loss_evaluator = make_gsm_loss_evaluator(cfg)