Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
| import ctypes | |
| from ctypes_enum import CtypesEnum | |
| from .EveProcessingStatus import * | |
| EVE_DETECTIONS_SIZE = 256 | |
| EVE_CLASS_ID_NAME_SIZE = 32 | |
| class EveActionStatus(CtypesEnum): | |
| EVE_IDLE = 0 | |
| EVE_INTERPOLATED = 1 | |
| EVE_COMPUTED = 2 | |
| EVE_NO_OUTPUT = 3 | |
| class FrontalStatus(CtypesEnum): | |
| UNKNOWN = 0 | |
| FRONTAL = 1 | |
| NON_FRONTAL = 2 | |
| class PPEStatus(CtypesEnum): | |
| PPE_UNKNOWN = 0 | |
| PPE_HARD_HAT = 1 | |
| NO_PPE = 2 | |
| class CSingleDetectionData(ctypes.Structure): | |
| _fields_ = [ | |
| ("topLeftX", ctypes.c_int), | |
| ("topLeftY", ctypes.c_int), | |
| ("bottomRightX", ctypes.c_int), | |
| ("bottomRightY", ctypes.c_int), | |
| ("classScore", ctypes.c_float), | |
| ("classId", ctypes.c_int), | |
| ("classIdName", ctypes.c_byte * EVE_CLASS_ID_NAME_SIZE), | |
| ("frontalStatus", ctypes.c_int), | |
| ("ppeStatus", ctypes.c_int), | |
| ] | |
| class CDetectionData(ctypes.Structure): | |
| _fields_ = [ | |
| ("processingStatus", ctypes.c_int), | |
| ("actionStatus", ctypes.c_int), | |
| ("numberOfDetections", ctypes.c_int), | |
| ("detections", CSingleDetectionData * EVE_DETECTIONS_SIZE), | |
| ] | |