Apollo 10.0
自动驾驶开放平台
ccrf_type_fusion.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 <functional>
20#include <map>
21#include <memory>
22#include <string>
23#include <vector>
24
25#include "modules/perception/radar4d_detection/lib/classifier/proto/ccrf_type_fusion_config.pb.h"
26
30
31namespace apollo {
32namespace perception {
33namespace radar4d {
34
36 public:
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 bool Init(const TypeFusionInitOption& option) override;
54 bool TypeFusion(const TypeFusionOption& option,
55 std::shared_ptr<perception::base::Object> object) override;
61 std::string Name() const override { return "CCRFOneShotTypeFusion"; }
71 const std::shared_ptr<perception::base::Object>& object,
72 Vectord* log_prob);
73
74 protected:
77};
78
80 public:
81 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
89 bool Init(const TypeFusionInitOption& option) override;
98 bool TypeFusion(const TypeFusionOption& option,
99 TrackedObjects* tracked_objects) override;
105 std::string Name() const override { return "CCRFSequenceTypeFusion"; }
106
107 protected:
108 // The fusion problem is modeled
109 // as inferring the discrete state in a chain CRFs.
110 // Note, log(P({X}|O)) =
111 // sigma_i{E_unary(X_i,O)} + sigma_ij{E_pairwise(X_i,X_j)} - logZ;
112 // E_unary(X_i,O) = sigma{logP(classifier)},
113 // E_pairwise(X_i,X_j) = logTransition(X_i,X_j)
114 // a) Maximize the sequence probability P(X_t|{X}^opt,O)
115 // based on optimal state inference.
116 // b) (did not use) Maximize the marginal probability P(X_t|O)
117 // with history state integrated.
118
119 // window version of Chain-CRFs inference
121 // util
122 bool RecoverFromLogProbability(Vectord* prob, std::vector<float>* dst,
124
125 protected:
127 // Note all in the log space
129
130 // data member for window inference version
134
135 protected:
136 double s_alpha_ = 1.8;
137};
138
139} // namespace radar4d
140} // namespace perception
141} // namespace apollo
std::string Name() const override
Get class name
bool TypeFusion(const TypeFusionOption &option, std::shared_ptr< perception::base::Object > object) override
Type fusion of objects
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool Init(const TypeFusionInitOption &option) override
INit type fusion
bool FuseOneShotTypeProbs(const std::shared_ptr< perception::base::Object > &object, Vectord *log_prob)
Get object type probabilities
apollo::common::EigenMap< std::string, Matrixd > smooth_matrices_
bool TypeFusion(const TypeFusionOption &option, TrackedObjects *tracked_objects) override
Type fusion of tracked object
bool RecoverFromLogProbability(Vectord *prob, std::vector< float > *dst, perception::base::ObjectType *type)
bool FuseWithConditionalProbabilityInference(TrackedObjects *tracked_objects)
std::string Name() const override
Get class name
apollo::common::EigenVector< Vectord > fused_sequence_probs_
apollo::common::EigenVector< Vectori > state_back_trace_
apollo::common::EigenVector< Vectord > fused_oneshot_probs_
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool Init(const TypeFusionInitOption &option) override
Init type fusion
std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > > > EigenMap
Definition eigen_defs.h:40
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition eigen_defs.h:33
Eigen::Matrix< double, VALID_OBJECT_TYPE, VALID_OBJECT_TYPE > Matrixd
Definition util.h:40
Eigen::Matrix< double, VALID_OBJECT_TYPE, 1 > Vectord
Definition util.h:38
class register implement
Definition arena_queue.h:37