| import os | |
| from ctypes import * | |
| from numpy.ctypeslib import ndpointer | |
| from face import Face | |
| libPath = os.path.abspath(os.path.dirname(__file__)) + '/lib/libopyfacerecog.so' | |
| opyfacerecog = cdll.LoadLibrary(libPath) | |
| getHWID = opyfacerecog.getHWID | |
| getHWID.argtypes = [] | |
| getHWID.restype = c_char_p | |
| setLicenseKey = opyfacerecog.setLicenseKey | |
| setLicenseKey.argtypes = [c_char_p] | |
| setLicenseKey.restype = c_int32 | |
| initSDK = opyfacerecog.initSDK | |
| initSDK.argtypes = [c_char_p] | |
| initSDK.restype = c_int32 | |
| processImage = opyfacerecog.processImage | |
| processImage.argtypes = [ndpointer(c_ubyte, flags='C_CONTIGUOUS'), c_int32, c_int32, POINTER(Face), c_int32] | |
| processImage.restype = c_int32 | |
| verifyFeat = opyfacerecog.verifyFeat | |
| verifyFeat.argtypes = [c_int32, c_ubyte * 512, c_int32, c_ubyte * 512] | |
| verifyFeat.restype = c_float | |