Apollo 10.0
自动驾驶开放平台
base_obstacle_detector.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <memory>
19#include <string>
20
21#include "Eigen/Core"
22
23#include "modules/perception/common/proto/model_info.pb.h"
24
25#include "cyber/common/macros.h"
30
31namespace apollo {
32namespace perception {
33namespace camera {
34
40
42 public:
44
45 virtual ~BaseObstacleDetector() = default;
53 virtual bool Init(const ObstacleDetectorInitOptions &options) = 0;
62 virtual bool Detect(CameraFrame *frame) = 0;
68 virtual std::string Name() const = 0;
77 virtual bool InitNetwork(const common::ModelInfo &model_info,
78 const std::string &model_root);
79
80 protected:
81 int gpu_id_ = 0;
82 std::shared_ptr<inference::Inference> net_;
83
85}; // class BaseObstacleDetector
86
88#define REGISTER_OBSTACLE_DETECTOR(name) \
89 PERCEPTION_REGISTER_CLASS(BaseObstacleDetector, name)
90
91} // namespace camera
92} // namespace perception
93} // namespace apollo
virtual std::string Name() const =0
Interface for obstacle detector name
virtual bool InitNetwork(const common::ModelInfo &model_info, const std::string &model_root)
Interface for network initialization
virtual bool Init(const ObstacleDetectorInitOptions &options)=0
Interface for loading obstacle detector config files
virtual bool Detect(CameraFrame *frame)=0
Interface for obstacle detector main part
std::shared_ptr< inference::Inference > net_
class register implement
Definition arena_queue.h:37
#define PERCEPTION_REGISTER_REGISTERER(base_class)
Definition registerer.h:92