77 init_options.
gpu_id = FLAGS_gpu_id;
80 std::string camera_name = FLAGS_camera_name;
82 algorithm::SensorManager::Instance()->GetUndistortCameraModel(
84 ACHECK(model) <<
"Can't find " << camera_name
85 <<
" in data/conf/sensor_meta.pb.txt";
87 init_options.
intrinsic = pinhole->get_intrinsic_params();
92 std::shared_ptr<BaseObstacleDetector> detector;
94 BaseObstacleDetectorRegisterer::GetInstanceByName(FLAGS_detector_name));
95 detector->Init(init_options);
98 std::string images_path = FLAGS_root_dir +
"/images/";
99 std::vector<std::string> img_file_names;
101 AERROR <<
"images_path: " << images_path <<
" get file list error.";
105 std::sort(img_file_names.begin(), img_file_names.end(),
106 [](
const std::string& lhs,
const std::string& rhs) {
107 if (lhs.length() != rhs.length()) {
108 return lhs.length() < rhs.length();
114 for (
const auto& img_file : img_file_names) {
115 AINFO <<
"img_file: " << img_file;
119 if (FLAGS_kitti_dir !=
"") {
120 std::string kitti_path = FLAGS_kitti_dir +
"/" + image_name +
".txt";
122 if (!
LoadKittiLabel(&camera_frame, kitti_path, FLAGS_dist_type)) {
123 AERROR <<
"Loading kitti result failed: " << kitti_path;
128 ACHECK(detector->Detect(&camera_frame));
133 AERROR <<
"Failed to create: " << FLAGS_dest_dir;
137 std::string result_path = FLAGS_dest_dir +
"/" + image_name +
".txt";
140 result_path = FLAGS_dest_dir +
"/" + image_name +
".jpg";