Example #1
0
    def initialize_visualization_drawer(self):
        visual_h = self.cfg.visualization.window_h
        visual_w = self.cfg.visualization.window_w
        self.drawer = FrameDrawer(visual_h, visual_w)

        self.drawer.assign_data(
            item="traj",
            top_left=[0, 0],
            bottom_right=[int(visual_h), int(visual_w)],
        )

        self.drawer.assign_data(
            item="match_temp",
            top_left=[int(visual_h / 4 * 0),
                      int(visual_w / 4 * 2)],
            bottom_right=[int(visual_h / 4 * 1),
                          int(visual_w / 4 * 4)],
        )

        self.drawer.assign_data(
            item="match_side",
            top_left=[int(visual_h / 4 * 1),
                      int(visual_w / 4 * 2)],
            bottom_right=[int(visual_h / 4 * 2),
                          int(visual_w / 4 * 4)],
        )

        self.drawer.assign_data(
            item="depth",
            top_left=[int(visual_h / 4 * 2),
                      int(visual_w / 4 * 2)],
            bottom_right=[int(visual_h / 4 * 3),
                          int(visual_w / 4 * 3)],
        )

        self.drawer.assign_data(
            item="flow1",
            top_left=[int(visual_h / 4 * 2),
                      int(visual_w / 4 * 3)],
            bottom_right=[int(visual_h / 4 * 3),
                          int(visual_w / 4 * 4)],
        )

        self.drawer.assign_data(
            item="flow2",
            top_left=[int(visual_h / 4 * 3),
                      int(visual_w / 4 * 2)],
            bottom_right=[int(visual_h / 4 * 4),
                          int(visual_w / 4 * 3)],
        )

        self.drawer.assign_data(
            item="flow_diff",
            top_left=[int(visual_h / 4 * 3),
                      int(visual_w / 4 * 3)],
            bottom_right=[int(visual_h / 4 * 4),
                          int(visual_w / 4 * 4)],
        )
Example #2
0
    def setup(self):
        """Reading configuration and setup, including

            - Timer
            - Dataset
            - Tracking method
            - Keypoint Sampler
            - Deep networks
            - Deep layers
            - Visualizer
        """
        # timer
        self.timers = Timer()

        # intialize dataset
        self.dataset = Dataset.datasets[self.cfg.dataset](self.cfg)

        # get tracking method
        self.tracking_method = self.cfg.tracking_method
        self.initialize_tracker()

        # initialize keypoint sampler
        self.kp_sampler = KeypointSampler(self.cfg)

        # Deep networks
        self.deep_models = DeepModel(self.cfg)
        self.deep_models.initialize_models()
        if self.cfg.online_finetune.enable:
            self.deep_models.setup_train()

        # Depth consistency
        if self.cfg.kp_selection.depth_consistency.enable:
            self.depth_consistency_computer = DepthConsistency(
                self.cfg, self.dataset.cam_intrinsics)

        # visualization interface
        self.drawer = FrameDrawer(self.cfg.visualization)