In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how Apollo adds a new evaluator to the prediction module. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Brief introduction
The evaluator generates features (original information from obstacles and current vehicles) by applying a pre-trained deep learning model to obtain model output.
To add an evaluator
Follow these steps to add an evaluator named NewEvaluator:
Add a field to the proto
Declare a class NewEvaluator that inherits from the Evaluator class
Implementation class NewEvaluator
Update Forecast configuration
Update evaluator management
Let's use the above method to add a new evaluator.
Declare a class that inherits from the Evaluator class
NewEvaluator
Create a new file new_evaluator.h under the modules/prediction/evaluator/vehicle directory. The statement is as follows:
# include "modules/prediction/evaluator/evaluator.h" namespace apollo {namespace prediction {class NewEvaluator: public Evaluator {public: NewEvaluator (); virtual ~ NewEvaluator (); void Evaluate (Obstacle* obstacle_ptr) override; / / Other useful functions and fields.} / / namespace prediction} / / namespace apollo
2. Implementation class NewEvaluator
Create a new file new_evaluator.cc in the same directory as new_evaluator.h. The implementation is as follows:
# include "modules/prediction/evaluator/vehicle/new_evaluator.h" namespace apollo {namespace prediction {NewEvaluator::NewEvaluator () {/ / Implement} NewEvaluator::~NewEvaluator () {/ / Implement} NewEvaluator::Evaluate (Obstacle* obstacle_ptr) () {/ / Extract features / / Compute new_output by applying pre-trained model} / / Other functions} / / namespace prediction} / / namespace apollo
Add a new evaluator to proto
Add a new evaluator type to prediction_conf.proto:
Enum EvaluatorType {MLP_EVALUATOR = 0; NEW_EVALUATOR = 1;}
Update the prediction_conf file
In modules/prediction/conf/prediction_conf.pb.txt, update the field evaluator_type as follows:
Obstacle_conf {obstacle_type: VEHICLE obstacle_status: ON_LANE evaluator_type: NEW_EVALUATOR predictor_type: NEW_PREDICTOR}
Update the management of the evaluator
Update CreateEvluator (...) as follows:
Case ObstacleConf::NEW_EVALUATOR: {evaluator_ptr.reset (new NewEvaluator ()); break;}
Update RegisterEvaluators () as follows:
RegisterEvaluator (ObstacleConf::NEW_EVALUATOR)
After completing the above steps, the new evaluator is created successfully.
Add a new feature
If you want to add new features, please follow these steps:
Add a field to the proto
Suppose the name of the new evaluation result is new_output and the type is int32. If the output is directly related to the obstacle, you can add it to the modules/prediction/proto/feature.proto, as follows:
Message Feature {/ / Other existing features optional int32 new_output = 1000;}
If the output is lane-related, add it to the modules/prediction/proto/lane_graph.proto as follows:
Message LaneSequence {/ / Other existing features optional int32 new_output = 1000;} Thank you for reading! This is the end of the article on "how to add a new evaluator to the prediction module of Apollo". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.