  import os
  
  class PluginLoader():
      @staticmethod
      def get_extractor(name):
          return PluginLoader._import("Extract", "Extract_{0}".format(name))
      
      @staticmethod
      def get_converter(name):
          return PluginLoader._import("Convert", "Convert_{0}".format(name))
      
      @staticmethod
      def get_model(name):
          return PluginLoader._import("Model", "Model_{0}".format(name))
      
      @staticmethod
      def get_trainer(name):
          return PluginLoader._import("Trainer", "Model_{0}".format(name))
      
      @staticmethod
      def _import(attr, name):
          print("Loading {} from {} plugin...".format(attr, name))
          module = __import__(name, globals(), locals(), [], 1)
          return getattr(module, attr)
  
      @staticmethod
      def get_available_models():
          models = ()
          for dir in next(os.walk( os.path.dirname(__file__) ))[1]:
              if dir[0:6].lower() == 'model_':
                  models += (dir[6:],)
          return models
          
      @staticmethod
      def get_default_model():
          models = PluginLoader.get_available_models()
          return 'Original' if 'Original' in models else models[0] 
</s> remove     @staticmethod
    def cv2_read_write(action, filename, image=None):
        """ Read or write an image using cv2 """
        if action == 'read':
            image = cv2.imread(filename)
        if action == 'write':
            cv2.imwrite(filename, image)
        return image

 </s> add  </s> remove     def read_input_images(self, input_dir):
 </s> add     @staticmethod
    def read_input_images(input_dir):
        """ Get the image paths """ </s> remove         self.faces_detected = dict()
        self.num_faces_detected = 0
        self.verify_output = False
 </s> add         return data </s> remove             face = DetectedFace()
            face.alignment_to_face(None, alignment)
            face = rotate_landmarks(face, rotation_matrix)
            alignment = face.face_to_alignment(alignment)
 </s> add             rotate_landmarks(alignment, rotation_matrix)
replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Extraction - Speed improvements (#522) (#523)

* Extraction - Speed improvements (#522)

* Initial Plugin restructure

* Detectors to plugins. Detector speed improvements

* Re-implement dlib aligner, remove models, FAN to TF. Parallel processing

* Update manual, update convert, implement parallel/serial switching

* linting + fix cuda check (setup.py). requirements update keras 2.2.4

* Add extract size option. Fix dlib hog init

* GUI: Increase tooltip width

* Update alignment tool to support new DetectedFace

* Add skip existing faces option

* Fix sort tool to new plugin structure

* remove old align plugin

* fix convert -skip faces bug

* Fix convert skipping no faces frames

* Convert - draw onto transparent layer

* Fix blur threshold bug

* fix skip_faces convert bug

* Fix training 
plugins/PluginLoader.py