提交 b8095f2a 编写于 作者: L Liangliang Zhang 提交者: Jiaming Tao

Perception: removed yolo_camera_detector.config

上级 bf7c571d
......@@ -149,3 +149,8 @@ DEFINE_string(cc_lane_post_processor_config_file,
DEFINE_string(probabilistic_fusion_config_file,
"modules/perception/model/probabilistic_fusion_config.pb.txt",
"The config file of probabilistic_fusion.");
DEFINE_string(yolo_config_filename, "config.pt", "Yolo config filename.");
DEFINE_string(
yolo_camera_detector_config,
"modules/perception/model/camera/yolo_camera_detector_config.pb.txt",
"Yolo camera detector config filename.");
......@@ -114,5 +114,7 @@ DECLARE_double(pbf_distance_speed_cos_diff);
DECLARE_string(cc_lane_post_processor_config_file);
DECLARE_string(probabilistic_fusion_config_file);
DECLARE_string(yolo_config_filename);
DECLARE_string(yolo_camera_detector_config);
#endif // MODULES_PERCEPTION_COMMON_PERCEPTION_GFLAGS_H_
......@@ -10,5 +10,4 @@ model_config_path: "model/traffic_light/rectifier.config"
model_config_path: "model/traffic_light/reviser.config"
model_config_path: "model/traffic_light/preprocessor.config"
model_config_path: "model/traffic_light/subnodes.config"
model_config_path: "model/camera/yolo_camera_detector.config"
model_config_path: "model/camera/geometry_camera_converter.config"
model_configs {
name: "YoloCameraDetector"
version: "1.0.0"
string_params {
name: "yolo_root"
value: "/apollo/modules/perception/model/yolo_camera_detector"
}
}
name: "YoloCameraDetector"
version: "1.0.0"
yolo_root: "/apollo/modules/perception/model/yolo_camera_detector"
......@@ -34,6 +34,7 @@ cc_library(
"//modules/perception/obstacle/camera/detector/yolo_camera_detector/proto:yolo_camera_proto",
"//modules/perception/obstacle/camera/dummy",
"//modules/perception/obstacle/camera/interface",
"//modules/perception/proto:yolo_camera_detector_config_lib_proto",
"@caffe//:lib",
"@eigen",
],
......
......@@ -27,32 +27,19 @@
#include "modules/perception/obstacle/camera/common/util.h"
#include "modules/perception/obstacle/camera/detector/yolo_camera_detector/util.h"
DEFINE_string(yolo_config_filename, "config.pt", "Yolo config filename.");
namespace apollo {
namespace perception {
using std::string;
using std::vector;
using std::unordered_map;
using apollo::common::util::GetProtoFromFile;
bool YoloCameraDetector::Init(const CameraDetectorInitOptions &options) {
ConfigManager *config_manager = ConfigManager::instance();
string model_name = this->Name();
const ModelConfig *model_config = config_manager->GetModelConfig(model_name);
if (model_config == nullptr) {
AERROR << "not found model: " << model_name;
return false;
}
string work_root = config_manager->WorkRoot();
string yolo_root;
if (!model_config->GetValue("yolo_root", &yolo_root)) {
AERROR << "yolo_root not found.";
return false;
}
yolo_root = apollo::common::util::GetAbsolutePath(work_root, yolo_root);
// load yolo camera detector config file to proto
CHECK(GetProtoFromFile(FLAGS_yolo_camera_detector_config, &config_));
const string &yolo_root = config_.yolo_root();
const string yolo_config = apollo::common::util::GetAbsolutePath(
yolo_root, FLAGS_yolo_config_filename);
......
......@@ -25,6 +25,7 @@
#include "caffe/caffe.hpp"
#include "modules/perception/obstacle/camera/detector/yolo_camera_detector/proto/yolo.pb.h"
#include "modules/perception/proto/yolo_camera_detector_config.pb.h"
#include "modules/perception/cuda_util/network.h"
#include "modules/perception/cuda_util/region_output.h"
......@@ -115,6 +116,8 @@ class YoloCameraDetector : public BaseCameraDetector {
obstacle::yolo::YoloParam yolo_param_;
int image_height_ = 0;
int image_width_ = 0;
yolo_camera_detector_config::ModelConfigs config_;
};
REGISTER_CAMERA_DETECTOR(YoloCameraDetector);
......
......@@ -48,3 +48,17 @@ proto_library(
"probabilistic_fusion_config.proto",
],
)
cc_proto_library(
name = "yolo_camera_detector_config_lib_proto",
deps = [
":yolo_camera_detector_config_lib",
],
)
proto_library(
name = "yolo_camera_detector_config_lib",
srcs = [
"yolo_camera_detector_config.proto",
],
)
syntax = "proto2";
package apollo.perception.yolo_camera_detector_config;
message ModelConfigs {
optional string name = 1 [ default = "YoloCameraDetector" ];
optional string version = 2 [ default = "1.0.0" ];
optional string yolo_root = 3 [ default = "/apollo/modules/perception/model/yolo_camera_detector" ];
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册