Nymbo/FaceLivenessDetection
0
1import os2 3from ctypes import *4from numpy.ctypeslib import ndpointer5from facebox import FaceBox6 7libPath = os.path.abspath(os.path.dirname(__file__)) + '/libfacesdk1.so'8facesdk = cdll.LoadLibrary(libPath)9 10getMachineCode = facesdk.getMachineCode11getMachineCode.argtypes = []12getMachineCode.restype = c_char_p13 14setActivation = facesdk.setActivation15setActivation.argtypes = [c_char_p]16setActivation.restype = c_int3217 18initSDK = facesdk.initSDK19initSDK.argtypes = [c_char_p]20initSDK.restype = c_int3221 22faceDetection = facesdk.faceDetection23faceDetection.argtypes = [ndpointer(c_ubyte, flags='C_CONTIGUOUS'), c_int32, c_int32, POINTER(FaceBox), c_int32]24faceDetection.restype = c_int3225 26 