<commit_before>/******************************************************************************
 * Copyright 2018 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#include <opencv2/opencv.hpp>

#include <fstream>
#include <iomanip>

#include "cyber/common/file.h"
#include "modules/common/util/string_util.h"
#include "modules/perception/base/distortion_model.h"
#include "modules/perception/camera/app/obstacle_camera_perception.h"
#include "modules/perception/camera/lib/calibration_service/online_calibration_service/online_calibration_service.h"
#include "modules/perception/camera/lib/calibrator/laneline/laneline_calibrator.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/external_feature_extractor.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/project_feature.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/tracking_feat_extractor.h"
#include "modules/perception/camera/lib/lane/detector/darkSCNN/darkSCNN_lane_detector.h"
#include "modules/perception/camera/lib/lane/detector/denseline/denseline_lane_detector.h"
#include "modules/perception/camera/lib/lane/postprocessor/darkSCNN/darkSCNN_lane_postprocessor.h"
#include "modules/perception/camera/lib/lane/postprocessor/denseline/denseline_lane_postprocessor.h"
#include "modules/perception/camera/lib/obstacle/detector/yolo/yolo_obstacle_detector.h"
#include "modules/perception/camera/lib/obstacle/postprocessor/location_refiner/location_refiner_obstacle_postprocessor.h"
#include "modules/perception/camera/lib/obstacle/tracker/omt/omt_obstacle_tracker.h"
#include "modules/perception/camera/lib/obstacle/transformer/multicue/multicue_obstacle_transformer.h"
#include "modules/perception/camera/tools/offline/transform_server.h"
#include "modules/perception/camera/tools/offline/visualizer.h"
#include "modules/perception/common/io/io_util.h"

DEFINE_string(test_list,
              "/apollo/modules/perception/testdata/camera/lib/obstacle/"
              "detector/yolo/img/full_test_list.txt",
              "test image list");
DEFINE_string(image_root,
              "/apollo/modules/perception/testdata/camera/lib/obstacle/"
              "detector/yolo/img/",
              "root directory of images");
DEFINE_string(image_ext, ".jpg", "extension of image name");
DEFINE_string(image_color, "bgr", "color space of image");
DEFINE_string(config_root,
              "/apollo/modules/perception/production/conf/perception/camera/",
              "config_root");
DEFINE_string(tf_file, "", "tf file");
DEFINE_string(config_file, "obstacle.pt", "config_file");
DEFINE_string(narrow_name, "front_12mm", " camera for projecting");
DEFINE_string(base_camera_name, "front_6mm", "camera to be projected");
DEFINE_string(sensor_name, "front_6mm,front_12mm", "camera to use");
DEFINE_string(params_dir, "/apollo/modules/perception/data/params",
              "params directory");
DEFINE_string(visualize_dir, "/tmp/0000", "visualize directory");
DEFINE_double(camera_fps, 15, "camera_fps");
DEFINE_bool(do_undistortion, false, "do_undistortion");
DEFINE_string(undistortion_save_dir, "./undistortion_result",
              "Directory to save undistored images.");
DEFINE_string(save_dir, "./result",
              "Directory to save result images with detections.");

namespace apollo {
namespace perception {
namespace camera {

REGISTER_OBSTACLE_DETECTOR(YoloObstacleDetector);<commit_msg>Perception: get rid of unused narrow_name flag<commit_after>/******************************************************************************
 * Copyright 2018 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#include <opencv2/opencv.hpp>

#include <fstream>
#include <iomanip>

#include "cyber/common/file.h"
#include "modules/common/util/string_util.h"
#include "modules/perception/base/distortion_model.h"
#include "modules/perception/camera/app/obstacle_camera_perception.h"
#include "modules/perception/camera/lib/calibration_service/online_calibration_service/online_calibration_service.h"
#include "modules/perception/camera/lib/calibrator/laneline/laneline_calibrator.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/external_feature_extractor.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/project_feature.h"
#include "modules/perception/camera/lib/feature_extractor/tfe/tracking_feat_extractor.h"
#include "modules/perception/camera/lib/lane/detector/darkSCNN/darkSCNN_lane_detector.h"
#include "modules/perception/camera/lib/lane/detector/denseline/denseline_lane_detector.h"
#include "modules/perception/camera/lib/lane/postprocessor/darkSCNN/darkSCNN_lane_postprocessor.h"
#include "modules/perception/camera/lib/lane/postprocessor/denseline/denseline_lane_postprocessor.h"
#include "modules/perception/camera/lib/obstacle/detector/yolo/yolo_obstacle_detector.h"
#include "modules/perception/camera/lib/obstacle/postprocessor/location_refiner/location_refiner_obstacle_postprocessor.h"
#include "modules/perception/camera/lib/obstacle/tracker/omt/omt_obstacle_tracker.h"
#include "modules/perception/camera/lib/obstacle/transformer/multicue/multicue_obstacle_transformer.h"
#include "modules/perception/camera/tools/offline/transform_server.h"
#include "modules/perception/camera/tools/offline/visualizer.h"
#include "modules/perception/common/io/io_util.h"

DEFINE_string(test_list,
              "/apollo/modules/perception/testdata/camera/lib/obstacle/"
              "detector/yolo/img/full_test_list.txt",
              "test image list");
DEFINE_string(image_root,
              "/apollo/modules/perception/testdata/camera/lib/obstacle/"
              "detector/yolo/img/",
              "root directory of images");
DEFINE_string(image_ext, ".jpg", "extension of image name");
DEFINE_string(image_color, "bgr", "color space of image");
DEFINE_string(config_root,
              "/apollo/modules/perception/production/conf/perception/camera/",
              "config_root");
DEFINE_string(tf_file, "", "tf file");
DEFINE_string(config_file, "obstacle.pt", "config_file");
DEFINE_string(base_camera_name, "front_6mm", "camera to be projected");
DEFINE_string(sensor_name, "front_6mm,front_12mm", "camera to use");
DEFINE_string(params_dir, "/apollo/modules/perception/data/params",
              "params directory");
DEFINE_string(visualize_dir, "/tmp/0000", "visualize directory");
DEFINE_double(camera_fps, 15, "camera_fps");
DEFINE_bool(do_undistortion, false, "do_undistortion");
DEFINE_string(undistortion_save_dir, "./undistortion_result",
              "Directory to save undistored images.");
DEFINE_string(save_dir, "./result",
              "Directory to save result images with detections.");

namespace apollo {
namespace perception {
namespace camera {

REGISTER_OBSTACLE_DETECTOR(YoloObstacleDetector);
{'fraction_non_alphanumeric': 0.14758396803595955, 'fraction_numerical': 0.00499438132101386, 'mean_word_length': 5.581758422350041, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6079407', 'n_tokens_mistral': 2497, 'n_tokens_neox': 2403, 'n_words': 440}