  from pathlib import Path
  from lib.FaceFilter import FaceFilter
  from lib.faces_detect import detect_faces, DetectedFace
  from lib.utils import get_image_paths, get_folder
  
  class FullPaths(argparse.Action):
      """Expand user- and relative-paths"""
  
 
</s> remove from lib.faces_detect import detect_faces
 </s> add from lib.faces_detect import detect_faces, DetectedFace </s> remove         if processes != 1:
            files = list(self.read_directory())
            for _ in tqdm(pool_process(self.processFiles, files, processes=processes), total = len(files)):
                self.faces_detected +=1
        else:
            try:
                for filename in tqdm(self.read_directory()):
                    self.handleImage(filename)

            except Exception as e:
                print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
 </s> add         try:
            if processes != 1:
                files = list(self.read_directory())
                for fn, faces in tqdm(pool_process(self.processFiles, files, processes=processes), total = len(files)):
                    self.num_faces_detected += 1
                    self.faces_detected[fn] = faces
            else:
                try:
                    for filename in tqdm(self.read_directory()):
                         self.faces_detected[filename] = self.handleImage(filename)[1]
                except Exception as e:
                    print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
        finally:
            self.write_alignments() </s> remove     def __init__(self, image, x, w, y, h, landmarks):
 </s> add     def __init__(self, image=None, x=None, w=None, y=None, h=None, landmarks=None, landmarksXY=None): </s> remove             self.faces_detected = self.faces_detected + 1
 </s> add             self.num_faces_detected += 1
from lib import Serializer
  from pathlib import Path
  from lib.FaceFilter import FaceFilter
  from lib.faces_detect import detect_faces, DetectedFace
  from lib.utils import get_image_paths, get_folder
from lib import Serializer
  
  class FullPaths(argparse.Action):
      """Expand user- and relative-paths"""
  
keep keep keep add keep keep keep keep
 Added serializers.

This speeds up convert speed x4 on my machine. 
lib/cli.py