123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef __CLIPAPP_H
- #define __CLIPAPP_H
- #include "ClipCfg.h"
- #include "Locks.h"
- #include "ExHeaders.h"
- #include <opencv2/opencv.hpp>
- #include "onnxruntime_cxx_api.h"
- NAMESPACE_MAS_BEGIN
- NAMESPACE_CLIP_BEGIN
- class ClipApp {
- public:
- static ClipApp* Instance();
- static void DestroyInstance();
- TZ_INT Initialize(const std::string& initParam);
- TZ_INT Dispose();
- TZ_INT DoDetect(cv::Mat& input, ClipDetectResult& detRes);
- private:
- ClipApp();
- ~ClipApp();
- TZ_BOOL m_inited;
- TZ_INT m_usecnt;
- Ort::Env* m_env;
- Ort::Session* m_session;
- Ort::SessionOptions m_sessionOptions;
- static tzc::Mutex _mutex;
- static ClipApp* _instance;
- TZ_INT PreprocessImage(cv::Mat& input, std::vector<float>& outputTensor);
- };
- NAMESPACE_CLIP_END
- NAMESPACE_MAS_END
- #endif
|