
import os
import sys

config = {
    'win32': {
        'detector': 'seeta_fd_lib.dll',
        'aligner': 'seeta_fa_lib.dll',
        'identifier': 'seeta_fi_lib.dll'
    },
    'darwin': {
        'detector': 'libseeta_fd_lib.dylib',
        'aligner': 'libseeta_fa_lib.dylib',
        'identifier': 'libseeta_fi_lib.dylib'
    },
    'linux': {
        'detector': 'libseeta_fd_lib.so',
        'aligner': 'libseeta_fa_lib.so',
        'identifier': 'libseeta_fi_lib.so'
    },
    # Ubuntu 16.04 x64 Python 2.7.12 (default, Nov 19 2016, 06:48:10) sys.platform return 'linux2'
    'linux2': {
        'detector': 'libseeta_fd_lib.so',
        'aligner': 'libseeta_fa_lib.so',
        'identifier': 'libseeta_fi_lib.so'
    }
}

def get_library_raise(name):
    dir = os.path.dirname(__file__)
    dlib = os.path.join(dir, '../SeetaFaceEngine/Release', config[sys.platform][name])
    if os.path.exists(dlib) and os.path.isfile(dlib):
	return dlib
    dlib = os.path.join(dir, '../SeetaFaceEngine/library', config[sys.platform][name])
    if os.path.exists(dlib) and os.path.isfile(dlib):
	return dlib
    dlib = os.path.join(dir, '../SeetaFaceEngine/library/Release', config[sys.platform][name])
    if os.path.exists(dlib) and os.path.isfile(dlib):
	return dlib
    raise RuntimeError("SeetaFaceEngine %s dynamic library %s can't find"%(name,config[sys.platform][name]))

def get_detector_library():
    return get_library_raise('detector')

def get_aligner_library():
    return get_library_raise('aligner')

def get_identifier_library():
    return get_library_raise('identifier')

@@ -923,33 +923,40 @@
 h.isfile(dlib):%0A
-%09
+        
 return dlib%0A    
@@ -1084,33 +1084,40 @@
 h.isfile(dlib):%0A
-%09
+        
 return dlib%0A    
@@ -1265,9 +1265,16 @@
 b):%0A
-%09
+        
 retu

Fix error on Python 3 Traceback (most recent call last): File "test.py", line 25, in <module> from pyseeta import Detector File "Source/pyseeta/pyseeta/__init__.py", line 4, in <module> from pyseeta.detector import Detector File "Source/pyseeta/pyseeta/detector.py", line 30, in <module> from .config import get_detector_library File "Source/pyseeta/pyseeta/config.py", line 33 return dlib ^ TabError: inconsistent use of tabs and spaces in indentation