28 std::string config_file =
32 AERROR <<
"Read feature extractor config file failed!";
35 if (feat_param.extractor_size() != 1) {
36 AERROR <<
"extractor should be 1";
43 std::vector<int> feat_blob_shape(feat_blob_shape_pb.begin(),
44 feat_blob_shape_pb.end());
46 std::make_shared<apollo::perception::base::Blob<float>>(feat_blob_shape);
57 <<
"Invalid aspect ratio: " << feat_height <<
"x" << feat_width
59 for (
int i = 0; i < feat_param.extractor_size(); i++) {
61 case tracking_feature::ExtractorParam_FeatureType_ROIPooling:
67 AERROR <<
"no proper extractor";
79 std::shared_ptr<FeatureExtractorLayer> feature_extractor_layer_ptr;
81 std::vector<int> shape{1, 5};
86 feature_extractor_layer_ptr->pooling_layer.reset(
89 feature_extractor_layer_ptr->top_blob.reset(
96 if (frame ==
nullptr) {
108 feature_extractor_layer_ptr->rois_blob->Reshape(
111 feature_extractor_layer_ptr->rois_blob->mutable_cpu_data();
115 obj->camera_supplement.box.xmin *
static_cast<float>(
feat_width_);
117 obj->camera_supplement.box.ymin *
static_cast<float>(
feat_height_);
119 obj->camera_supplement.box.xmax *
static_cast<float>(
feat_width_);
121 obj->camera_supplement.box.ymax *
static_cast<float>(
feat_height_);
122 ADEBUG << rois_data[0] <<
" " << rois_data[1] <<
" " << rois_data[2]
123 <<
" " << rois_data[3] <<
" " << rois_data[4];
124 rois_data += feature_extractor_layer_ptr->rois_blob->offset(1);
128 feature_extractor_layer_ptr->pooling_layer->ForwardGPU(
129 {feat_blob, feature_extractor_layer_ptr->rois_blob},
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...