vid_clothes.h
3.27 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*************************************************************************
* Version: vid_clothes_recognition_v0.0.0.20220325
* CopyRight :
* UpdateDate:20220325
* Content : 司乘人员衣服颜色识别
*************************************************************************/
#ifndef VIDCLOTHES_H_
#define VIDCLOTHES_H_
#if _MSC_VER
#ifdef VIDCLOTHES_EXPORTS
#define VIDCLOTHES_API __declspec(dllexport)
#else
#define VIDCLOTHES_API __declspec(dllimport)
#endif
#else
#define VIDCLOTHES_API __attribute__ ((visibility ("default")))
#endif
#include "sy_common.h"
#ifdef __cplusplus
extern "C"
{
#endif
//2.车颜色结果
#ifndef VIDCLOTHES_RESULT_
#define VIDCLOTHES_RESULT_
typedef struct vidclothes_result
{
float score{0.0};
int index {14}; //13类:"棕", "橙", "灰", "白", "粉", "紫", "红", "绿", "蓝", "银", "青", "黄", "黑"
}vidclothes_result;
#endif
#ifndef __VIDCLOTHES_PARAM__
#define __VIDCLOTHES_PARAM__
typedef struct vidclothes_param
{
int devId; //指定显卡id
char* modelNames;
float thresld; //阈值
vidclothes_param() :devId(0), thresld(0.6) {};
}vidclothes_param;
#endif
/*************************************************************************
* FUNCTION: vidclothes_init
* PURPOSE: 载入模型
* PARAM:
[in] handle - 句柄
[in] params - 参数
* RETURN: 成功(0)或者错误代码
* NOTES:
*************************************************************************/
VIDCLOTHES_API int vidclothes_init(void ** handle, vidclothes_param param);
/*************************************************************************
* FUNCTION: vidclothes_process
* PURPOSE: 车颜色识别
* PARAM:
[in] handle - 检测句柄
[in] img_data - 图像数据
[in] result - 结果 内存在外部申请
* RETURN: 成功(0) 或 错误代码(< 0)
* NOTES:
*************************************************************************/
VIDCLOTHES_API int vidclothes_process(void *handle, sy_img img_data, vidclothes_result * result);
/*************************************************************************
* FUNCTION: vidclothes_batch
* PURPOSE: 车颜色识别 batch
* PARAM:
[in] handle - 检测句柄
[in] img_data_array - 图像数据
[in] batch_size - 图像数目
[in] result - 结果 内存在外部申请
* RETURN: 成功(0) 或 错误代码(< 0)
* NOTES:
*************************************************************************/
VIDCLOTHES_API int vidclothes_batch(void *handle, sy_img* img_data_array, int batch_size, vidclothes_result * result);
/*************************************************************************
* FUNCTION: vidclothes_release
* PURPOSE: 释放
* PARAM:
[in] handle - handle
* RETURN: NULL
* NOTES:
*************************************************************************/
VIDCLOTHES_API void vidclothes_release(void ** handle);
/*************************************************************************
* FUNCTION: vidclothes_get_version
* PURPOSE:
* PARAM: NULL
* RETURN: 版本号
* NOTES:
*************************************************************************/
VIDCLOTHES_API const char * vidclothes_get_version();
#ifdef __cplusplus
};
#endif
#endif