beaupreda's picture
Upload sensAI-Generic-Object-Detection with upload_repo.py
13170f7 verified
Raw
History Blame Contribute Delete
19.7 kB
import ctypes
from . import eve_sdk_structs as structs
EveProcessingCallbackFn = ctypes.CFUNCTYPE(None, ctypes.POINTER(structs.EveProcessingCallbackReturnData))
class EveSDK:
def __init__(self, dll_path: str):
self.cdll = ctypes.CDLL(dll_path)
# EveCamera.h
self.cdll.EveGetFormats.restype = structs.EveCameraFormats
self.cdll.EveGetFormats.argtypes = [ctypes.c_uint, structs.CCameraFormat]
self.cdll.EveGetCamera.restype = structs.EveCamera
self.cdll.EveGetCamera.argtypes = [ctypes.c_uint]
self.cdll.EveSetCamera.restype = structs.EveError
self.cdll.EveSetCamera.argtypes = [ctypes.c_uint, structs.CCameraFormat]
self.cdll.EveGetNumberOfCameras.restype = structs.EveNumberOfCameras
self.cdll.EveGetNumberOfCameras.argtypes = []
self.cdll.EveGetMonitors.restype = structs.EveMonitors
self.cdll.EveGetMonitors.argtypes = []
self.cdll.EveChangeCameraLocation.restype = structs.EveCameraLocation
self.cdll.EveChangeCameraLocation.argtypes = [structs.EveCameraLocation]
self.cdll.EveGetLiveCameraParameters.restype = structs.EveCameraParameters
self.cdll.EveGetLiveCameraParameters.argtypes = []
# EveControlInterface.h
self.cdll.CreateEve.restype = structs.EveError
self.cdll.CreateEve.argtypes = [structs.EveStartupParameters]
self.cdll.EveRegisterDataCallback.restype = structs.EveError
self.cdll.EveRegisterDataCallback.argtypes = [EveProcessingCallbackFn]
self.cdll.StartEve.restype = structs.EveError
self.cdll.StartEve.argtypes = []
self.cdll.StartEveWithParameters.restype = structs.EveError
self.cdll.StartEveWithParameters.argtypes = [structs.EveProcessingParameters]
self.cdll.EveSendImageForProcessing.restype = structs.EveError
self.cdll.EveSendImageForProcessing.argtypes = [structs.EveInputImage]
self.cdll.EveSendImageForProcessingWithParams.restype = structs.EveError
self.cdll.EveSendImageForProcessingWithParams.argtypes = [structs.EveInputImage, structs.CCameraParameters]
self.cdll.ShutdownEve.restype = structs.EveError
self.cdll.ShutdownEve.argtypes = []
self.cdll.EveCheckForLicense.restype = structs.EveLicenseResult
self.cdll.EveCheckForLicense.argtypes = []
self.cdll.EveResetPipeline.restype = structs.EveError
self.cdll.EveResetPipeline.argtypes = []
# EveKarolinska.h
self.cdll.EveConfigureKarolinska.restype = structs.EveKarolinskaOptions
self.cdll.EveConfigureKarolinska.argtypes = [structs.EveKarolinskaOptions]
self.cdll.EveGetKarolinskaData.restype = structs.EveKarolinskaData
self.cdll.EveGetKarolinskaData.argtypes = []
# EveFaceId.h
self.cdll.EveConfigureFaceId.restype = structs.EveFaceIdOptions
self.cdll.EveConfigureFaceId.argtypes = [structs.EveFaceIdOptions]
self.cdll.EveFaceIdCalibrateCurrent.restype = structs.EveError
self.cdll.EveFaceIdCalibrateCurrent.argtypes = []
self.cdll.EveFaceIdCalibrateNew.restype = structs.EveError
self.cdll.EveFaceIdCalibrateNew.argtypes = []
self.cdll.EveFaceIdForceIdentify.restype = structs.EveError
self.cdll.EveFaceIdForceIdentify.argtypes = []
self.cdll.EveFaceIdRemoveCurrent.restype = structs.EveError
self.cdll.EveFaceIdRemoveCurrent.argtypes = []
self.cdll.EveFaceIdRemoveAll.restype = structs.EveError
self.cdll.EveFaceIdRemoveAll.argtypes = []
self.cdll.EveFaceIdReloadGallery.restype = structs.EveError
self.cdll.EveFaceIdReloadGallery.argtypes = []
self.cdll.EveFaceIdCommandWaiting.restype = ctypes.c_uint
self.cdll.EveFaceIdCommandWaiting.argtypes = []
self.cdll.EveGetFaceIdData.restype = structs.EveFaceIdData
self.cdll.EveGetFaceIdData.argtypes = []
self.cdll.EveSendFaceIdCommand.restype = structs.EveFaceIdCommandStruct
self.cdll.EveSendFaceIdCommand.argtypes = [structs.EveFaceIdCommandStruct]
# EveFaceTracker.h
self.cdll.EveConfigureFaceTracker.restype = structs.EveFaceTrackerOptions
self.cdll.EveConfigureFaceTracker.argtypes = [structs.EveFaceTrackerOptions]
self.cdll.EveGetEyesData.restype = structs.EveEyes
self.cdll.EveGetEyesData.argtypes = []
self.cdll.EveGetPupilsData.restype = structs.EvePupils
self.cdll.EveGetPupilsData.argtypes = []
self.cdll.EveGetAllFaceData.restype = structs.EveAllFacesData
self.cdll.EveGetAllFaceData.argtypes = []
# EveFpga.h
self.cdll.EveConfigureFpga.restype = structs.EveFpgaOptions
self.cdll.EveConfigureFpga.argtypes = [structs.EveFpgaOptions]
self.cdll.EveConfigureFpgaDebug.restype = structs.EveFpgaDebugOptions
self.cdll.EveConfigureFpgaDebug.argtypes = [structs.EveFpgaDebugOptions]
self.cdll.QueryFpgaSetting.restype = structs.EveError
self.cdll.QueryFpgaSetting.argtypes = [structs.pipeline_config_t, ctypes.c_bool]
self.cdll.QueryFpgaSettings.restype = structs.EveError
self.cdll.QueryFpgaSettings.argtypes = [ctypes.c_uint16, ctypes.c_uint32, ctypes.c_bool]
self.cdll.SendSetSetting.restype = structs.EveError
self.cdll.SendSetSetting.argtypes = [structs.pipeline_config_t]
self.cdll.PopQueuedSetting.restype = structs.CFpgaGetSetting
self.cdll.PopQueuedSetting.argtypes = []
self.cdll.EveGetFpgaData.restype = structs.EveFpgaData
self.cdll.EveGetFpgaData.argtypes = []
self.cdll.FpgaReadJson.restype = structs.EveFpgaJsonMetadata
self.cdll.FpgaReadJson.argtypes = []
self.cdll.FpgaReadData.restype = structs.EveFpgaData
self.cdll.FpgaReadData.argtypes = []
self.cdll.EveSendImageForProcessingWithFpgaData.restype = structs.EveError
self.cdll.EveSendImageForProcessingWithFpgaData.argtypes = [structs.EveInputImage, structs.EveFpgaManualData]
# EveImageManipulation.h
self.cdll.EveConfigureImageManipulation.restype = structs.EveImageManipulationOptions
self.cdll.EveConfigureImageManipulation.argtypes = [structs.EveImageManipulationOptions]
# EveImage.h
self.cdll.EveGetProcessedImage.restype = structs.EveProcessedImage
self.cdll.EveGetProcessedImage.argtypes = []
self.cdll.EveGetProcessedFrameTime.restype = structs.EveProcessedFrameTime
self.cdll.EveGetProcessedFrameTime.argtypes = []
self.cdll.EveConfigureProcessedImage.restype = structs.EveImageFormatRequest
self.cdll.EveConfigureProcessedImage.argtypes = [structs.EveImageFormatRequest]
self.cdll.EveConfigureRawImage.restype = structs.EveRawImageRequest
self.cdll.EveConfigureRawImage.argtypes = [structs.EveRawImageRequest]
self.cdll.EveGetRawImage.restype = structs.EveProcessedImage
self.cdll.EveGetRawImage.argtypes = []
self.cdll.EveGetJsonData.restype = structs.EveJsonData
self.cdll.EveGetJsonData.argtypes = []
# EveObjectDetection.h
self.cdll.EveConfigureObjectDetection.restype = structs.EveObjectDetectionOptions
self.cdll.EveConfigureObjectDetection.argtypes = [structs.EveObjectDetectionOptions]
self.cdll.EveGetDefaultObjectDetectionOptions.restype = structs.EveObjectDetectionOptions
self.cdll.EveGetDefaultObjectDetectionOptions.argtypes = []
self.cdll.EveConfigurePersonDetection.restype = structs.EvePersonDetectionOptions
self.cdll.EveConfigurePersonDetection.argtypes = [structs.EvePersonDetectionOptions]
self.cdll.EveGetObjectDetectionData.restype = structs.EveDetectionData
self.cdll.EveGetObjectDetectionData.argtypes = []
self.cdll.EveCopyObjectDetectionData.restype = structs.EveDetectionData
self.cdll.EveCopyObjectDetectionData.argtypes = []
self.cdll.EveGetPersonDetectionData.restype = structs.EveDetectionData
self.cdll.EveGetPersonDetectionData.argtypes = []
self.cdll.EveCopyPersonDetectionData.restype = structs.EveDetectionData
self.cdll.EveCopyPersonDetectionData.argtypes = []
self.cdll.DeleteDetectionData.restype = structs.EveError
self.cdll.DeleteDetectionData.argtypes = [structs.EveDetectionData]
# EveROI.h
self.cdll.EveConfigureROIs.restype = structs.EveROIOptions
self.cdll.EveConfigureROIs.argtypes = [structs.EveROIOptions]
self.cdll.EveGetROIScoreData.restype = structs.EveROIScoreData
self.cdll.EveGetROIScoreData.argtypes = []
# EveHandGesture.h
self.cdll.EveConfigureHandGesture.restype = structs.EveHandGestureOptions
self.cdll.EveConfigureHandGesture.argtypes = [structs.EveHandGestureOptions]
self.cdll.EveGetHandGestureData.restype = structs.EveHandGestureData
self.cdll.EveGetHandGestureData.argtypes = []
self.cdll.EveCopyHandGestureData.restype = structs.EveHandGestureData
self.cdll.EveCopyHandGestureData.argtypes = []
self.cdll.EveDeleteHandGestureData.restype = structs.EveError
self.cdll.EveDeleteHandGestureData.argtypes = [structs.EveHandGestureData]
self.cdll.EveGetStaticGestureDetections.restype = structs.EveStaticGestureData
self.cdll.EveGetStaticGestureDetections.argtypes = []
self.cdll.EveGetStaticGestureDefinitions.restype = structs.EveStaticGestureDefinitions
self.cdll.EveGetStaticGestureDefinitions.argtypes = []
self.cdll.EveAddStaticGesture.restype = structs.EveError
self.cdll.EveAddStaticGesture.argtypes = [structs.EveStaticGestureDefinition]
self.cdll.EveDeleteStaticGesture.restype = structs.EveError
self.cdll.EveDeleteStaticGesture.argtypes = [structs.EveStaticGestureDefinition]
# EveAlgorithm.h
self.cdll.EveGetAlgorithms.restype = structs.EveSupportedAlgorithms
self.cdll.EveGetAlgorithms.argtypes = []
# EveTiming.h
self.cdll.EveGetTimingInformation.restype = structs.EveTiming
self.cdll.EveGetTimingInformation.argtypes = []
# EveCamera.h
def EveGetFormats(self, cameraId: ctypes.c_uint, filter: structs.CCameraFormat) -> structs.EveCameraFormats:
return self.cdll.EveGetFormats(cameraId, filter)
def EveGetCamera(self, cameraId: ctypes.c_uint) -> structs.EveCamera:
return self.cdll.EveGetCamera(cameraId)
def EveSetCamera(self, cameraId: ctypes.c_uint, filter: structs.CCameraFormat) -> structs.EveError:
return self.cdll.EveSetCamera(cameraId, filter)
def EveGetNumberOfCameras(self) -> structs.EveNumberOfCameras:
return self.cdll.EveGetNumberOfCameras()
def EveGetMonitors(self) -> structs.EveMonitors:
return self.cdll.EveGetMonitors()
def EveChangeCameraLocation(self, location: structs.EveCameraLocation) -> structs.EveCameraLocation:
return self.cdll.EveChangeCameraLocation(location)
def EveGetLiveCameraParameters(self) -> structs.EveCameraParameters:
return self.cdll.EveGetLiveCameraParameters()
# EveControlInterface.h
def CreateEve(self, options: structs.EveStartupParameters) -> structs.EveError:
return self.cdll.CreateEve(options)
def EveRegisterDataCallback(self, callback) -> structs.EveError:
return self.cdll.EveRegisterDataCallback(callback)
def StartEve(self) -> structs.EveError:
return self.cdll.StartEve()
def StartEveWithParameters(self, parameters: structs.EveProcessingParameters) -> structs.EveError:
return self.cdll.StartEveWithParameters(parameters)
def EveSendImageForProcessing(self, image: structs.EveInputImage) -> structs.EveError:
return self.cdll.EveSendImageForProcessing(image)
def EveSendImageForProcessingWithParams(self, image: structs.EveInputImage, params: structs.CCameraParameters) -> structs.EveError:
return self.cdll.EveSendImageForProcessingWithParams(image, params)
def EveSendImageForProcessingWithFpgaData(self, image: structs.EveInputImage, data: structs.EveFpgaManualData) -> structs.EveError:
return self.cdll.EveSendImageForProcessingWithFpgaData(image, data)
def ShutdownEve(self) -> structs.EveError:
return self.cdll.ShutdownEve()
def EveCheckForLicense(self) -> structs.EveLicenseResult:
return self.cdll.EveCheckForLicense()
def EveResetPipeline(self) -> structs.EveError:
return self.cdll.EveResetPipeline()
# EveFaceId.h
def EveConfigureFaceId(self, options: structs.EveFaceIdOptions) -> structs.EveFaceIdOptions:
return self.cdll.EveConfigureFaceId(options)
def EveFaceIdCalibrateCurrent(self) -> structs.EveError:
return self.cdll.EveFaceIdCalibrateCurrent()
def EveFaceIdCalibrateNew(self) -> structs.EveError:
return self.cdll.EveFaceIdCalibrateNew()
def EveFaceIdForceIdentify(self) -> structs.EveError:
return self.cdll.EveFaceIdForceIdentify()
def EveFaceIdRemoveCurrent(self) -> structs.EveError:
return self.cdll.EveFaceIdRemoveCurrent()
def EveFaceIdRemoveAll(self) -> structs.EveError:
return self.cdll.EveFaceIdRemoveAll()
def EveFaceIdReloadGallery(self) -> structs.EveError:
return self.cdll.EveFaceIdReloadGallery()
def EveFaceIdCommandWaiting(self) -> ctypes.c_uint:
return self.cdll.EveFaceIdCommandWaiting()
def EveGetFaceIdData(self) -> structs.EveFaceIdData:
return self.cdll.EveGetFaceIdData()
def EveSendFaceIdCommand(self, command: structs.EveFaceIdCommandStruct) -> structs.EveFaceIdCommandStruct:
return self.cdll.EveSendFaceIdCommand(command)
# EveFaceTracker.h
def EveConfigureFaceTracker(self, options: structs.EveFaceTrackerOptions) -> structs.EveFaceTrackerOptions:
return self.cdll.EveConfigureFaceTracker(options)
def EveGetEyesData(self) -> structs.EveEyes:
return self.cdll.EveGetEyesData()
def EveGetPupilsData(self) -> structs.EvePupils:
return self.cdll.EveGetPupilsData()
def EveGetAllFaceData(self) -> structs.EveAllFacesData:
return self.cdll.EveGetAllFaceData()
# EveFpga.h
def EveGetFpgaData(self) -> structs.EveFpgaData:
return self.cdll.EveGetFpgaData()
def EveConfigureFpga(self, options: structs.EveFpgaOptions) -> structs.EveFpgaOptions:
return self.cdll.EveConfigureFpga(options)
def EveConfigureFpgaDebug(self, options: structs.EveFpgaDebugOptions) -> structs.EveFpgaDebugOptions:
return self.cdll.EveConfigureFpgaDebug(options)
def QueryFpgaSetting(self, command: structs.pipeline_config_t, notify: ctypes.c_bool) -> structs.EveError:
return self.cdll.QueryFpgaSetting(command, notify)
def QueryFpgaSettings(self, typeMask: ctypes.c_uint16, settingsMask: ctypes.c_uint32, notify: ctypes.c_bool) -> structs.EveError:
return self.cdll.QueryFpgaSettings(typeMask, settingsMask, notify)
def SendSetSetting(self, command: structs.pipeline_config_t) -> structs.EveError:
return self.cdll.SendSetSetting(command)
def PopQueuedSetting(self) -> structs.CFpgaGetSetting:
return self.cdll.PopQueuedSetting()
def FpgaReadJson(self) -> structs.EveFpgaJsonMetadata:
return self.cdll.FpgaReadJson()
def FpgaReadData(self) -> structs.EveFpgaData:
return self.cdll.FpgaReadData()
# EveKarolinska.h
def EveConfigureKarolinska(self, parameters: structs.EveKarolinskaOptions) -> structs.EveKarolinskaOptions:
return self.cdll.EveConfigureKarolinska(parameters)
def EveGetKarolinskaData(self) -> structs.EveKarolinskaData:
return self.cdll.EveGetKarolinskaData()
# EveImageManipulation.h
def EveConfigureImageManipulation(self, options: structs.EveImageManipulationOptions) -> structs.EveImageManipulationOptions:
return self.cdll.EveConfigureImageManipulation(options)
# EveImage.h
def EveGetProcessedImage(self) -> structs.EveProcessedImage:
return self.cdll.EveGetProcessedImage()
def EveGetProcessedFrameTime(self) -> structs.EveProcessedFrameTime:
return self.cdll.EveGetProcessedFrameTime()
def EveConfigureProcessedImage(self, fmt: structs.EveImageFormatRequest) -> structs.EveImageFormatRequest:
return self.cdll.EveConfigureProcessedImage(fmt)
def EveConfigureRawImage(self, fmt: structs.EveRawImageRequest) -> structs.EveRawImageRequest:
return self.cdll.EveConfigureRawImage(fmt)
def EveGetRawImage(self) -> structs.EveProcessedImage:
return self.cdll.EveGetRawImage()
def EveGetJsonData(self) -> structs.EveJsonData:
return self.cdll.EveGetJsonData()
# EveObjectDetection.h
def EveConfigureObjectDetection(self, options: structs.EveObjectDetectionOptions) -> structs.EveObjectDetectionOptions:
return self.cdll.EveConfigureObjectDetection(options)
def EveGetDefaultObjectDetectionOptions(self) -> structs.EveObjectDetectionOptions:
return self.cdll.EveGetDefaultObjectDetectionOptions()
def EveConfigurePersonDetection(self, options: structs.EvePersonDetectionOptions) -> structs.EvePersonDetectionOptions:
return self.cdll.EveConfigurePersonDetection(options)
def EveGetObjectDetectionData(self) -> structs.EveDetectionData:
return self.cdll.EveGetObjectDetectionData()
def EveCopyObjectDetectionData(self) -> structs.EveDetectionData:
return self.cdll.EveCopyObjectDetectionData()
def EveGetPersonDetectionData(self) -> structs.EveDetectionData:
return self.cdll.EveGetPersonDetectionData()
def EveCopyPersonDetectionData(self) -> structs.EveDetectionData:
return self.cdll.EveCopyPersonDetectionData()
def DeleteDetectionData(self, data: structs.EveDetectionData) -> structs.EveError:
return self.cdll.DeleteDetectionData(data)
# EveROI.h
def EveConfigureROIs(self, options: structs.EveROIOptions) -> structs.EveROIOptions:
return self.cdll.EveConfigureROIs(options)
def EveGetROIScoreData(self) -> structs.EveROIScoreData:
return self.cdll.EveGetROIScoreData()
# EveHandGesture.h
def EveConfigureHandGesture(self, options: structs.EveHandGestureOptions) -> structs.EveHandGestureOptions:
return self.cdll.EveConfigureHandGesture(options)
def EveGetHandGestureData(self) -> structs.EveHandGestureData:
return self.cdll.EveGetHandGestureData()
def EveCopyHandGestureData(self) -> structs.EveHandGestureData:
return self.cdll.EveCopyHandGestureData()
def EveDeleteHandGestureData(self, data: structs.EveHandGestureData) -> structs.EveError:
return self.cdll.EveDeleteHandGestureData(data)
def EveGetStaticGestureDetections(self) -> structs.EveStaticGestureData:
return self.cdll.EveGetStaticGestureDetections()
def EveGetStaticGestureDefinitions(self) -> structs.EveStaticGestureDefinitions:
return self.cdll.EveGetStaticGestureDefinitions()
def EveAddStaticGesture(self, definition: structs.EveStaticGestureDefinition) -> structs.EveError:
return self.cdll.EveAddStaticGesture(definition)
def EveDeleteStaticGesture(self, definition: structs.EveStaticGestureDefinition) -> structs.EveError:
return self.cdll.EveDeleteStaticGesture(definition)
# EveAlgorithm.h
def EveGetAlgorithms(self) -> structs.EveSupportedAlgorithms:
return self.cdll.EveGetAlgorithms()
# EveTiming.h
def EveGetTimingInformation(self) -> structs.EveTiming:
return self.cdll.EveGetTimingInformation()