github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/swig/pycv/pycv.h (about)

     1  #ifndef GOCV_CGO_SWIG_PYCV_PYCV_H_
     2  #define GOCV_CGO_SWIG_PYCV_PYCV_H_
     3  
     4  #include <pybind11/embed.h>
     5  
     6  #include <stdexcept>
     7  #include <string>
     8  
     9  namespace pybind11 {
    10  class object;
    11  }
    12  
    13  namespace pycv {
    14  
    15  struct LocalInitRequest {
    16      int gpu_id = -1;
    17      std::string sdk_dir;
    18  
    19      std::string model_dir;
    20  };
    21  struct LocalInitResponse {};
    22  
    23  struct DoRequest {
    24      std::string arg1;
    25      std::string arg2;
    26  };
    27  
    28  struct DoResponse {};
    29  
    30  #ifdef SWIG
    31  class PyImage {
    32  #else
    33  class __attribute__((visibility("hidden"))) PyImage {
    34  #endif
    35  pybind11::object sdk_py;
    36  
    37  public:
    38  PyImage() = default;
    39  ~PyImage();
    40  
    41  static void GlobalInit(const std::string& model_dir, int gpu_id);
    42  
    43  static void GlobalRelease();
    44  
    45  void LocalInit(const LocalInitRequest& req, LocalInitResponse& resp);
    46  
    47  void Do(const DoRequest& req, DoResponse& resp);
    48  
    49  };
    50  
    51  }  // namespace pycv
    52  
    53  #endif