Apollo
10.0
自动驾驶开放平台
model_manager.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
17
#pragma once
18
19
#include <string>
20
#include <vector>
21
#include <memory>
22
#include <mutex>
23
#include <map>
24
#include <utility>
25
26
#include "
cyber/cyber.h
"
27
#include "
cyber/plugin_manager/plugin_manager.h
"
28
#include "modules/prediction/proto/prediction_conf.pb.h"
29
#include "
modules/prediction/evaluator/model_manager/model/model_base.h
"
30
31
32
namespace
apollo
{
33
namespace
prediction {
34
35
class
ModelManager
{
36
public
:
37
ModelManager
();
38
~ModelManager
() {}
39
45
bool
Init
();
46
55
std::shared_ptr<ModelBase>
SelectModel
(
const
Model::Backend
& backend,
56
const
ObstacleConf::EvaluatorType
& evaluator_type,
57
const
apollo::perception::PerceptionObstacle::Type
&
58
obstacle_type);
59
60
private
:
61
std::map<std::string, std::vector<std::shared_ptr<ModelBase>>> models_;
62
std::string to_string(
const
Model
& model_config);
63
std::string to_string(
const
Model::Backend
& backend,
64
const
ObstacleConf::EvaluatorType
& evaluator_type,
65
const
apollo::perception::PerceptionObstacle::Type
&
66
obstacle_type);
67
EvaluatorModelConf
evaluator_model_conf_;
68
};
69
70
}
// namespace prediction
71
}
// namespace apollo
apollo::prediction::ModelManager
Definition
model_manager.h:35
apollo::prediction::ModelManager::ModelManager
ModelManager()
Definition
model_manager.cc:29
apollo::prediction::ModelManager::SelectModel
std::shared_ptr< ModelBase > SelectModel(const Model::Backend &backend, const ObstacleConf::EvaluatorType &evaluator_type, const apollo::perception::PerceptionObstacle::Type &obstacle_type)
select the best model
Definition
model_manager.cc:100
apollo::prediction::ModelManager::Init
bool Init()
init model manager add load all defined plugin
Definition
model_manager.cc:41
apollo::prediction::ModelManager::~ModelManager
~ModelManager()
Definition
model_manager.h:38
plugin_manager.h
cyber.h
model_base.h
apollo
class register implement
Definition
arena_queue.h:37
apollo::perception::PerceptionObstacle::Type
Type
Definition
perception_obstacle.proto:83
apollo::prediction::EvaluatorModelConf
Definition
prediction_conf.proto:76
apollo::prediction::Model
Definition
prediction_conf.proto:80
apollo::prediction::Model::Backend
Backend
Definition
prediction_conf.proto:81
apollo::prediction::ObstacleConf::EvaluatorType
EvaluatorType
Definition
prediction_conf.proto:17
modules
prediction
evaluator
model_manager
model_manager.h