bindings_ie.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. //
  5. // Copyright (C) 2020 Intel Corporation
  6. #ifndef OPENCV_GAPI_INFER_BINDINGS_IE_HPP
  7. #define OPENCV_GAPI_INFER_BINDINGS_IE_HPP
  8. #include <opencv2/gapi/util/any.hpp>
  9. #include "opencv2/gapi/own/exports.hpp" // GAPI_EXPORTS
  10. #include <opencv2/gapi/gkernel.hpp> // GKernelPackage
  11. #include <opencv2/gapi/infer/ie.hpp> // Params
  12. #include <string>
  13. namespace cv {
  14. namespace gapi {
  15. namespace ie {
  16. // NB: Used by python wrapper
  17. // This class can be marked as SIMPLE, because it's implemented as pimpl
  18. class GAPI_EXPORTS_W_SIMPLE PyParams {
  19. public:
  20. GAPI_WRAP
  21. PyParams() = default;
  22. GAPI_WRAP
  23. PyParams(const std::string &tag,
  24. const std::string &model,
  25. const std::string &weights,
  26. const std::string &device);
  27. GAPI_WRAP
  28. PyParams(const std::string &tag,
  29. const std::string &model,
  30. const std::string &device);
  31. GAPI_WRAP
  32. PyParams& constInput(const std::string &layer_name,
  33. const cv::Mat &data,
  34. TraitAs hint = TraitAs::TENSOR);
  35. GAPI_WRAP
  36. PyParams& cfgNumRequests(size_t nireq);
  37. GAPI_WRAP
  38. PyParams& cfgBatchSize(const size_t size);
  39. GBackend backend() const;
  40. std::string tag() const;
  41. cv::util::any params() const;
  42. private:
  43. std::shared_ptr<Params<cv::gapi::Generic>> m_priv;
  44. };
  45. GAPI_EXPORTS_W PyParams params(const std::string &tag,
  46. const std::string &model,
  47. const std::string &weights,
  48. const std::string &device);
  49. GAPI_EXPORTS_W PyParams params(const std::string &tag,
  50. const std::string &model,
  51. const std::string &device);
  52. } // namespace ie
  53. } // namespace gapi
  54. } // namespace cv
  55. #endif // OPENCV_GAPI_INFER_BINDINGS_IE_HPP