Example #1
0
            model = models[obj_id]
            for est_id, est in ests_sorted:
                est_errs = []
                R_est = est['cam_R_m2c']
                t_est = est['cam_t_m2c']

                for gt_id, gt in enumerate(scene_gt[im_id]):
                    if gt['obj_id'] != obj_id:
                        continue

                    err = -1.0
                    R_gt = gt['cam_R_m2c']
                    t_gt = gt['cam_t_m2c']

                    if error_type == 'vsd':
                        err = pose_error.vsd(R_est, t_est, R_gt, t_gt, model,
                                             depth_im, delta, tau, K)
                    elif error_type == 'add':
                        err = pose_error.add(R_est, t_est, R_gt, t_gt, model)
                    elif error_type == 'adi':
                        err = pose_error.adi(R_est, t_est, R_gt, t_gt, model)
                    elif error_type == 'cou':
                        err = pose_error.cou(R_est, t_est, R_gt, t_gt, model,
                                             dp['test_im_size'], K)
                    elif error_type == 're':
                        err = pose_error.re(R_est, R_gt)
                    elif error_type == 'te':
                        err = pose_error.te(t_est, t_gt)

                    errs.append([im_id, obj_id, est_id, gt_id, err])
            #print('Evaluation time: {}s'.format(time.time() - t))
Example #2
0
                est_errs = []
                R_e = est['R']
                t_e = est['t']

                errs_gts = {}  # Errors w.r.t. GT poses of the same object
                for gt_id, gt in enumerate(scene_gt[im_id]):
                    if gt['obj_id'] != obj_id:
                        continue

                    e = -1.0
                    R_g = gt['cam_R_m2c']
                    t_g = gt['cam_t_m2c']

                    if error_type == 'vsd':
                        e = pose_error.vsd(R_e, t_e, R_g, t_g, models[obj_id],
                                           depth_im, K, vsd_delta, vsd_tau,
                                           vsd_cost)
                    elif error_type == 'add':
                        e = pose_error.add(R_e, t_e, R_g, t_g, models[obj_id])
                    elif error_type == 'adi':
                        e = pose_error.adi(R_e, t_e, R_g, t_g, models[obj_id])
                    elif error_type == 'cou':
                        e = pose_error.cou(R_e, t_e, R_g, t_g, models[obj_id],
                                           dp['test_im_size'], K)
                    elif error_type == 're':
                        e = pose_error.re(R_e, R_g)
                    elif error_type == 'te':
                        e = pose_error.te(t_e, t_g)

                    errs_gts[gt_id] = e
Example #3
0
                est_errs = []
                R_e = est['R']
                t_e = est['t']

                errs_gts = {} # Errors w.r.t. GT poses of the same object
                for gt_id, gt in enumerate(scene_gt[im_id]):
                    if gt['obj_id'] != obj_id:
                        continue

                    e = -1.0
                    R_g = gt['cam_R_m2c']
                    t_g = gt['cam_t_m2c']

                    if error_type == 'vsd':
                        e = pose_error.vsd(R_e, t_e, R_g, t_g, models[obj_id],
                                           depth_im, K, vsd_delta, vsd_tau,
                                           vsd_cost)
                    elif error_type == 'add':
                        e = pose_error.add(R_e, t_e, R_g, t_g, models[obj_id])
                    elif error_type == 'adi':
                        e = pose_error.adi(R_e, t_e, R_g, t_g, models[obj_id])
                    elif error_type == 'cou':
                        e = pose_error.cou(R_e, t_e, R_g, t_g, models[obj_id],
                                           dp['test_im_size'], K)
                    elif error_type == 're':
                        e = pose_error.re(R_e, R_g)
                    elif error_type == 'te':
                        e = pose_error.te(t_e, t_g)

                    errs_gts[gt_id] = e