31 const std::string& model_root) {
34 model_root, model_info.proto_file().file());
36 model_root, model_info.weight_file().file());
39 std::vector<std::string> input_names =
41 std::vector<std::string> output_names =
45 const auto& framework = model_info.framework();
46 std::string plugin_name = model_info.infer_plugin();
47 static const std::string class_namespace =
"apollo::perception::inference::";
48 if (model_info.has_infer_plugin() && !plugin_name.empty()) {
49 plugin_name = class_namespace + plugin_name;
53 AINFO <<
"net load plugin success: " << plugin_name;
56 weight_file, output_names,
57 input_names, model_root));
63 std::map<std::string, std::vector<int>> shape_map;
67 if (!
net_->Init(shape_map)) {
68 AERROR << model_info.name() <<
"init failed!";
Inference * CreateInferenceByName(const std::string &frame_work, const std::string &proto_file, const std::string &weight_file, const std::vector< std::string > &outputs, const std::vector< std::string > &inputs, const std::string &model_root)