You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

11 months ago
'''
数据结构定义类
'''
import ctypes
'''
iDataType 0-心跳1-设备端登录2-手机端登录3-
'''
class CSHeadMessage(ctypes.Structure):
_fields_ = [
('Flag',ctypes.c_char * 4),
('iDataType',ctypes.c_int),
('iDataLen',ctypes.c_int)
]
class CSDevLogin_Data(ctypes.Structure):
_fields_ = [('DID',ctypes.c_char * 32)]
class CSAPPLogin_Data(ctypes.Structure):
_fields_ = [
('username', ctypes.c_char * 32),
('passwd', ctypes.c_char * 32)
]
class ModelinData:
def __init__(self,channel_id,img,image,scale_ratio, pad_size):
self.channel_id = channel_id #通道ID
self.img = img #预处理后的图片数据
self.image = image #原图的数据
self.scale_ratio = scale_ratio
self.pad_size = pad_size
11 months ago
def __del__(self):
pass
class ModeloutData:
def __init__(self,image,scale_ratio, pad_size,outputs,channel_id):
self.image = image #原图
self.outputs = outputs #模型推理后结果
self.scale_ratio = scale_ratio
self.pad_size = pad_size
self.channel_id = channel_id
def __del__(self):
pass