x_postprocess.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include <algorithm>
  16. #include <iostream>
  17. #include <map>
  18. #include <string>
  19. #include <utility>
  20. #include <vector>
  21. #include <opencv2/core/core.hpp>
  22. #include <opencv2/highgui/highgui.hpp>
  23. #include <opencv2/imgproc/imgproc.hpp>
  24. #include "yaml-cpp/yaml.h"
  25. #include "model_deploy/common/include/output_struct.h"
  26. #include "model_deploy/common/include/base_postprocess.h"
  27. #include "model_deploy/ppseg/include/seg_postprocess.h"
  28. #include "model_deploy/ppdet/include/det_postprocess.h"
  29. #include "model_deploy/ppclas/include/clas_postprocess.h"
  30. namespace PaddleDeploy {
  31. class XPostprocess : public BasePostprocess {
  32. public:
  33. bool Init(const YAML::Node& yaml_config);
  34. virtual bool Run(const std::vector<DataBlob>& outputs,
  35. const std::vector<ShapeInfo>& shape_infos,
  36. std::vector<Result>* results, int thread_num = 1);
  37. private:
  38. std::string model_type_;
  39. SegPostprocess seg_post_process;
  40. DetPostprocess det_post_process;
  41. ClasPostprocess clas_post_process;
  42. // std::vector<std::string> labels_;
  43. };
  44. } // namespace PaddleDeploy