Apollo  6.0
Open source self driving car software
tracking_feat_extractor.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 #include <vector>
21 
26 #include "modules/perception/camera/lib/feature_extractor/tfe/proto/tracking_feature.pb.h"
30 
31 namespace apollo {
32 namespace perception {
33 namespace camera {
35  std::shared_ptr<inference::Layer<float>> pooling_layer;
36  std::shared_ptr<base::Blob<float>> rois_blob;
37  std::shared_ptr<base::Blob<float>> top_blob;
38 };
40  public:
43 
44  bool Init(const FeatureExtractorInitOptions &init_options) override;
45  bool Extract(const FeatureExtractorOptions &options,
46  CameraFrame *frame) override;
47  std::string Name() const override { return "TrackingFeatureExtractor"; }
48 
49  protected:
50  void init_roipooling(const FeatureExtractorInitOptions &init_options,
51  const tracking_feature::ROIPoolingParam &param);
52  std::vector<std::shared_ptr<FeatureExtractorLayer>> roi_poolings_;
54  int input_height_ = 0;
55  int input_width_ = 0;
56  int feat_width_ = 0;
57  int feat_height_ = 0;
58 };
59 
60 } // namespace camera
61 } // namespace perception
62 } // namespace apollo
Definition: camera_frame.h:33
std::shared_ptr< base::Blob< float > > top_blob
Definition: tracking_feat_extractor.h:37
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: tracking_feat_extractor.h:34
std::vector< std::shared_ptr< FeatureExtractorLayer > > roi_poolings_
Definition: tracking_feat_extractor.h:52
Definition: base_feature_extractor.h:43
Definition: tracking_feat_extractor.h:39
std::shared_ptr< base::Blob< float > > rois_blob
Definition: tracking_feat_extractor.h:36
bool Init(const char *binary_name)
TrackingFeatureExtractor()
Definition: tracking_feat_extractor.h:41
inference::GPUL2Norm norm_
Definition: tracking_feat_extractor.h:53
std::shared_ptr< inference::Layer< float > > pooling_layer
Definition: tracking_feat_extractor.h:35
Definition: base_feature_extractor.h:46
std::string Name() const override
Definition: tracking_feat_extractor.h:47
Definition: base_feature_extractor.h:36
~TrackingFeatureExtractor()
Definition: tracking_feat_extractor.h:42