Spaces:
Running
Running
File size: 687 Bytes
36f0d8c |
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 |
import os
from ctypes import *
from numpy.ctypeslib import ndpointer
from facebox import FaceBox
libPath = os.path.abspath(os.path.dirname(__file__)) + '/libfacesdk1.so'
facesdk = cdll.LoadLibrary(libPath)
getMachineCode = facesdk.getMachineCode
getMachineCode.argtypes = []
getMachineCode.restype = c_char_p
setActivation = facesdk.setActivation
setActivation.argtypes = [c_char_p]
setActivation.restype = c_int32
initSDK = facesdk.initSDK
initSDK.argtypes = [c_char_p]
initSDK.restype = c_int32
faceDetection = facesdk.faceDetection
faceDetection.argtypes = [ndpointer(c_ubyte, flags='C_CONTIGUOUS'), c_int32, c_int32, POINTER(FaceBox), c_int32]
faceDetection.restype = c_int32
|