44 const std::string& dist_type) {
46 FILE *fp = fopen(kitti_path.c_str(),
"r");
48 AERROR <<
"Failed to load object file: " << kitti_path;
62 memset(type, 0,
sizeof(type));
65 ret = fscanf(fp,
"%254s %f %f %lf %f %f %f %f %f %f %f %lf %lf %lf %f %f",
66 type, &trash, &trash, &obj->camera_supplement.alpha, &x1, &y1,
67 &x2, &y2, &obj->size[2], &obj->size[1], &obj->size[0],
68 &obj->center[0], &obj->center[1], &obj->center[2], &obj->theta,
70 AINFO <<
"fscanf return: " << ret;
71 if (dist_type ==
"H-from-h") {
72 obj->size[0] =
static_cast<float>(obj->center[2]);
73 }
else if (dist_type ==
"H-on-h") {
74 obj->size[0] =
static_cast<float>(obj->center[2]) * (y2 - y1);
76 AERROR <<
"Not supported dist type! " << dist_type;
79 obj->camera_supplement.box.xmin = std::max<float>(x1, 0);
80 obj->camera_supplement.box.ymin = std::max<float>(y1, 0);
81 obj->camera_supplement.box.xmax =
84 obj->camera_supplement.box.ymax =
87 obj->camera_supplement.area_id = 5;
95 obj->type_probs.assign(
97 obj->sub_type_probs.assign(
99 obj->sub_type_probs[
static_cast<int>(obj->sub_type)] = score;
100 obj->type_probs[
static_cast<int>(obj->type)] = score;