Bläddra i källkod

add get_model_name

FlyingQianMM 4 år sedan
förälder
incheckning
0e4b206e4f

+ 3 - 0
dygraph/deploy/cpp/model_deploy/common/include/base_preprocess.h

@@ -46,6 +46,8 @@ class BasePreprocess {
                    std::vector<ShapeInfo>* shape_info,
                    int thread_num = 1) = 0;
 
+  virtual std::string GetModelName() { return model_name_; }
+
  protected:
   bool BuildTransform(const YAML::Node& yaml_config);
   std::vector<std::shared_ptr<Transform>> transforms_;
@@ -54,6 +56,7 @@ class BasePreprocess {
   std::shared_ptr<Transform> CreateTransform(const std::string& name);
   Padding batch_padding_;
   Permute permute_;
+  std::string model_name_;
 };
 
 }  // namespace PaddleDeploy

+ 1 - 0
dygraph/deploy/cpp/model_deploy/paddlex/include/x_preprocess.h

@@ -33,6 +33,7 @@ class XPreprocess : public BasePreprocess {
                    std::vector<DataBlob>* inputs,
                    std::vector<ShapeInfo>* shape_info,
                    int thread_num = 1);
+  virtual std::string GetModelName() { return model_name_; }
 
  private:
   std::string model_type_;