              extension = Path(filename).suffix
              out_filename = "{}_{}{}".format(str(output_file), str(idx), extension)
  
              face = detected_face["face"]
              resized_face = face.aligned_face
  
              face.hash, img = encode_image_with_hash(resized_face, extension)
              self.save_queue.put((out_filename, img))
              final_faces.append(face.to_alignment())
          self.alignments.data[os.path.basename(filename)] = final_faces
 
</s> remove             extension = Path(filename).suffix
 </s> add             extension = '.png' </s> remove     def align_face(self, faces, size, filename):
        """ Align the detected face and add the destination file path """
        final_faces = list()
        image = faces["image"]
        detected_faces = faces["detected_faces"]
        for face in detected_faces:
            face.load_aligned(image, size=size)
            final_faces.append({"file_location": self.output_dir / Path(filename).stem,
                                "face": face})
        faces["detected_faces"] = final_faces

 </s> add  </s> remove             aligned_landmarks = face.aligned_landmarks
 </s> add             aligned_landmarks = face.feed_landmarks </s> remove         self.align_face(faces, size, filename)
 </s> add         final_faces = list()
        for detected_face in faces["detected_faces"]:
            filename = self.output_dir / Path(detected_face.filename).stem
            final_faces.append({"file_location": filename,
                                "face": detected_face})
        faces["detected_faces"] = final_faces </s> remove                 offset:offset + foregrounds[idx].shape[1]] = foregrounds[idx]
 </s> add                 offset:offset + foregrounds[idx].shape[1], :3] = foregrounds[idx]
            resized_face = face.feed_face
              extension = Path(filename).suffix
              out_filename = "{}_{}{}".format(str(output_file), str(idx), extension)
  
              face = detected_face["face"]
            resized_face = face.feed_face
            resized_face = face.feed_face
              face.hash, img = encode_image_with_hash(resized_face, extension)
              self.save_queue.put((out_filename, img))
              final_faces.append(face.to_alignment())
          self.alignments.data[os.path.basename(filename)] = final_faces
keep keep keep keep replace replace keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
scripts/extract.py