forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClipAPI.h
More file actions
40 lines (30 loc) · 827 Bytes
/
ClipAPI.h
File metadata and controls
40 lines (30 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <opencv2/opencv.hpp>
#if defined(_MSC_VER)
#define LIB_API __declspec(dllexport)
#else
#define LIB_API __attribute__((visibility("default")))
#endif
///
struct CLIPResult
{
CLIPResult() = default;
CLIPResult(const std::string& label, float conf) noexcept
: m_label(label), m_conf(conf)
{
}
std::string m_label;
float m_conf = 0.f;
};
///
class LIB_API ClassificationCLIP
{
public:
ClassificationCLIP() noexcept;
~ClassificationCLIP() noexcept;
bool Init(const std::string& pathToClip, const std::string& pathToBPE, int inputImgSize, int indGPU, const std::vector<std::string>& labels);
bool ProcessFrame(const cv::Mat& frame, const std::vector<cv::Rect>& rois, std::vector<CLIPResult>& result);
class ClassificationCLIPImpl;
private:
ClassificationCLIPImpl* m_pImpl = nullptr;
};