Apollo 11.0
自动驾驶开放平台
junction_map_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 <memory>
20#include <string>
21#include <vector>
22
26#include "torch/extension.h"
27#include "torch/script.h"
28
29namespace apollo {
30namespace prediction {
31
33 public:
38 explicit JunctionMapEvaluator(SemanticMap* semantic_map);
39
43 virtual ~JunctionMapEvaluator() = default;
44
48 void Clear();
49
55 bool Evaluate(Obstacle* obstacle_ptr,
56 ObstaclesContainer* obstacles_container) override;
57
63 bool ExtractFeatureValues(Obstacle* obstacle_ptr,
64 std::vector<double>* feature_values);
65
69 std::string GetName() override { return "JUNCTION_MAP_EVALUATOR"; }
70
71 private:
75 void LoadModel();
76
77 private:
78 // junction exit mask
79 static const size_t JUNCTION_FEATURE_SIZE = 12;
80 torch::jit::script::Module torch_model_;
81 torch::Device device_;
82 SemanticMap* semantic_map_;
83};
84
85} // namespace prediction
86} // namespace apollo
std::string GetName() override
Get the name of evaluator.
bool ExtractFeatureValues(Obstacle *obstacle_ptr, std::vector< double > *feature_values)
Extract feature vector
virtual ~JunctionMapEvaluator()=default
Destructor
bool Evaluate(Obstacle *obstacle_ptr, ObstaclesContainer *obstacles_container) override
Override Evaluate
Prediction obstacle.
Definition obstacle.h:52
class register implement
Definition arena_queue.h:37
Obstacles container
Define the data container base class