FaceLiveness / opyfacelive.py
cadyderwin's picture
Upload 56 files
0ab7531 verified
raw
history blame contribute delete
643 Bytes
import os
from ctypes import *
from numpy.ctypeslib import ndpointer
libPath = os.path.abspath(os.path.dirname(__file__)) + '/lib/libopyfacelive.so'
libopyfacelive = cdll.LoadLibrary(libPath)
getHWID = libopyfacelive.getHWID
getHWID.argtypes = []
getHWID.restype = c_char_p
setLicenseKey = libopyfacelive.setLicenseKey
setLicenseKey.argtypes = [c_char_p]
setLicenseKey.restype = c_int32
initSDK = libopyfacelive.initSDK
initSDK.argtypes = [c_char_p]
initSDK.restype = c_int32
processImage = libopyfacelive.processImage
processImage.argtypes = [ndpointer(c_ubyte, flags='C_CONTIGUOUS'), c_int32, c_int32]
processImage.restype = c_char_p