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)) print('Saving calculated errors...') errs_path = errs_mpath.format(result_path=result_path, scene_id=scene_id, err_desc=err_desc) misc.ensure_dir(os.path.dirname(errs_path)) inout.save_errors_sixd2017(errs_path, errs)
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 errs.append({ 'im_id': im_id, 'obj_id': obj_id, 'est_id': est_id, 'score': est['score'], 'errors': errs_gts }) # print('Evaluation time: {}s'.format(time.time() - t)) print('Saving errors...') errors_path = errors_mpath.format(result_path=result_path, result_name=result_name,