23 #include "cyber/common/file.h" 29 #include "modules/perception/camera/lib/obstacle/detector/yolo/proto/yolo.pb.h" 36 namespace perception {
43 if (stream_ !=
nullptr) {
44 cudaStreamDestroy(stream_);
53 std::string
Name()
const override {
return "YoloObstacleDetector"; }
57 void LoadParam(
const yolo::YoloParam &yolo_param);
58 bool InitNet(
const yolo::YoloParam &yolo_param,
59 const std::string &model_root);
64 std::shared_ptr<BaseFeatureExtractor> feature_extractor_;
65 yolo::YoloParam yolo_param_;
66 std::shared_ptr<base::BaseCameraModel> base_camera_model_ =
nullptr;
67 std::shared_ptr<inference::Inference> inference_;
68 std::vector<base::ObjectSubType> types_;
69 std::vector<float> expands_;
70 std::vector<float> anchors_;
73 cudaStream_t stream_ =
nullptr;
78 int obj_k_ = kMaxObjSize;
81 float confidence_threshold_ = 0.f;
82 float light_vis_conf_threshold_ = 0.f;
83 float light_swt_conf_threshold_ = 0.f;
87 std::shared_ptr<base::Image8U> image_ =
nullptr;
88 std::shared_ptr<base::Blob<bool>> overlapped_ =
nullptr;
89 std::shared_ptr<base::Blob<int>> idx_sm_ =
nullptr;
91 bool with_box3d_ =
false;
92 bool with_frbox_ =
false;
93 bool with_lights_ =
false;
94 bool with_ratios_ =
false;
95 bool with_area_id_ =
false;
96 float border_ratio_ = 0.f;
void LoadInputShape(const yolo::ModelParam &model_param)
void LoadParam(const yolo::YoloParam &yolo_param)
Definition: camera_frame.h:33
Definition: base_obstacle_detector.h:35
Definition: region_output.h:69
Definition: region_output.h:112
Definition: base_obstacle_detector.h:37
void InitYoloBlob(const yolo::NetworkParam &net_param)
bool Init(const ObstacleDetectorInitOptions &options=ObstacleDetectorInitOptions()) override
YoloObstacleDetector()
Definition: yolo_obstacle_detector.h:41
std::string Name() const override
Definition: yolo_obstacle_detector.h:53
bool InitFeatureExtractor(const std::string &root_dir)
bool InitNet(const yolo::YoloParam &yolo_param, const std::string &model_root)
virtual ~YoloObstacleDetector()
Definition: yolo_obstacle_detector.h:42
Definition: base_obstacle_detector.h:30
Definition: region_output.h:76
bool Detect(const ObstacleDetectorOptions &options, CameraFrame *frame) override
Definition: yolo_obstacle_detector.h:39