def gen_aligned_faces(basedir):
    face_files = glob.glob(join(basedir, FACE_SUBDIR, '*'))
    aligned_face_dir = join(basedir, ALIGNED_FACE_SUBDIR)
    if not os.path.exists(aligned_face_dir):
        os.mkdir(aligned_face_dir)
    # get reference shape
    # ok_lm_files = glob.glob(join(basedir, FACE_LM_SUBDIR, '*01_landmarks.txt'))
    ref_face = imread(join(basedir, FACE_SUBDIR, 
                           'S011_006_00000001.png'), False)
    ref_lms = read_landmarks(join(basedir, FACE_LM_SUBDIR, 
                                  'S011_006_00000001_landmarks.txt'))
    for idx, face_file in enumerate(face_files):
        # aligning face
        face = cv2.imread(face_file, False)
        lm_file_base = (os.path.basename(face_file).split('.')[0] +
                        '_landmarks.txt')
        lms = read_landmarks(join(basedir, FACE_LM_SUBDIR, lm_file_base))
        aligned_face = pwa.warp(face, lms, ref_lms)
        aligned_face_file = join(aligned_face_dir, os.path.basename(face_file))
        cv2.imwrite(aligned_face_file, aligned_face)        
        if idx % 50 == 0 and idx != 0:
            print('%d files processed' % idx)
    print('Done.')
Returns the query as a string of SQL with the parameter values
dataset/ETHPy150Open dfdx/masque/bin/datagen.py/gen_aligned_faces--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/query.py/Query.__str__