Ejemplo n.º 1
0
    def update_label_map(self, map, bev_corners, reg_target):
        label_corners = (bev_corners / 4) / 0.1
        label_corners[:, 1] += self.geometry['label_shape'][0] / 2

        points = get_points_in_a_rotated_box(label_corners)

        for p in points:
            label_x = p[0]
            label_y = p[1]
            metric_x, metric_y = trasform_label2metric(np.array(p))
            actual_reg_target = np.copy(reg_target)
            actual_reg_target[2] = reg_target[2] - metric_x
            actual_reg_target[3] = reg_target[3] - metric_y
            actual_reg_target[4] = np.log(reg_target[4])
            actual_reg_target[5] = np.log(reg_target[5])

            map[label_y, label_x, 0] = 1.0
            map[label_y, label_x, 1:7] = actual_reg_target
Ejemplo n.º 2
0
    def update_label_map(self, map, bev_corners, reg_target):
        '''
        x forward y right --> x right y forward
        '''
        label_corners = (bev_corners / 4 ) / 0.1                       # 4x downsamples 
        label_corners[:, 1] += self.geometry['label_shape'][0] / 2     # 200, 175, 7   ?????

        points = get_points_in_a_rotated_box(label_corners)

        for p in points:
            label_x = p[0]
            label_y = p[1]
            metric_x, metric_y = trasform_label2metric(np.array(p)) 
            actual_reg_target = np.copy(reg_target)                  # cos, sin, x, y, w,l
            actual_reg_target[2] = reg_target[2] - metric_x          # dx
            actual_reg_target[3] = reg_target[3] - metric_y          # dy
            actual_reg_target[4] = np.log(reg_target[4])             # log(w)
            actual_reg_target[5] = np.log(reg_target[5])             # log(l)

            map[label_y, label_x, 0] = 1.0
            map[label_y, label_x, 1:7] = actual_reg_target           # x to right  y to forward