base_reprocessing_unit.h
1.88 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
/*
* @Author: your name
* @Date: 2021-11-17 18:58:13
* @LastEditTime: 2021-12-15 14:37:23
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /tsl_aiplatform/src/tsl_aiplatform/reprocessing_module/base_reprocessing_unit.h
*/
#pragma once
#ifdef POST_USE_RABBITMQ
#include "../ai_platform/header.h"
#endif // #ifdef POST_USE_RABBITMQ
#include "stl_aiplatform_header.h"
#include "snapshot_reprocessing.h"
#include "task_param_manager.h"
#include "./post_reprocessing.hpp"
#ifndef _MSC_VER
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define Sleep(a) usleep((a)*1000)
//typedef int BOOL;
#define BOOL bool
typedef unsigned int DWORD;
typedef void* LPVOID;
#endif
enum class data_device_t
{
GPU = 0,
CPU = 1,
};
typedef struct multi_image_t
{
const sy_img &ori_img, &roi_img;
std::string ori_fpath, roi_fpath;
data_device_t ori_data_device, roi_data_device;
explicit multi_image_t(const sy_img &_ori_img, const sy_img &_roi_img)
: ori_img(_ori_img)
, roi_img(_roi_img)
{}
} multi_image_t;
class base_reprocessing_unit
{
protected:
task_param_manager *_task_param_manager;
typedef std::function<bool(const char *msg)> callback_t;
public:
snapshot_reprocessing *_snapshot_reprocessing;
base_reprocessing_unit() {};
virtual ~base_reprocessing_unit() {};
#ifdef POST_USE_RABBITMQ
virtual void set_callback(callback_t cb) = 0;
#endif
virtual void reprocessing_process(const OBJ_KEY &obj_key) = 0;
virtual void reprocessing_process_face(const OBJ_KEY &obj_key) = 0; //人脸快照后处理函数
virtual void reprocessing_process_wo_locus(const OBJ_KEY &obj_key, const multi_image_t &m_image, bool enable_async
#ifdef POST_USE_RABBITMQ
, const std::string &json_str
#endif
) = 0;
};