Apollo 10.0
自动驾驶开放平台
semantic_lstm_evaluator.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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 <utility>
21#include <vector>
22
26#include "torch/extension.h"
27#include "torch/script.h"
28
29namespace apollo {
30namespace prediction {
31
33 public:
38 explicit SemanticLSTMEvaluator(SemanticMap* semantic_map);
39
43 virtual ~SemanticLSTMEvaluator() = default;
44
48 void Clear();
49
55 bool Evaluate(Obstacle* obstacle_ptr,
56 ObstaclesContainer* obstacles_container) override;
57
64 Obstacle* obstacle_ptr,
65 std::vector<std::pair<double, double>>* pos_history);
66
70 std::string GetName() override { return "SEMANTIC_LSTM_EVALUATOR"; }
71
72 private:
76 void LoadModel();
77
78 private:
79 ModelManager model_manager_;
80 at::Tensor torch_default_output_tensor_;
81 Model::Backend device_;
82 SemanticMap* semantic_map_;
83};
84
85} // namespace prediction
86} // namespace apollo
Prediction obstacle.
Definition obstacle.h:52
bool ExtractObstacleHistory(Obstacle *obstacle_ptr, std::vector< std::pair< double, double > > *pos_history)
Extract obstacle history
std::string GetName() override
Get the name of evaluator.
bool Evaluate(Obstacle *obstacle_ptr, ObstaclesContainer *obstacles_container) override
Override Evaluate
virtual ~SemanticLSTMEvaluator()=default
Destructor
class register implement
Definition arena_queue.h:37
Define the data container base class