Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 1,015 Bytes
13170f7 | 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 | 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),
]
|