          0 - all logs shown
          1 - filter out INFO logs
          2 - filter out WARNING logs
          3 - filter out ERROR logs  """
      # TODO suppress tensorflow deprecation warnings """
  
      os.environ['TF_CPP_MIN_LOG_LEVEL'] = loglevel
      if loglevel != '0':
          for warncat in (FutureWarning, DeprecationWarning):
              warnings.simplefilter(action='ignore', category=warncat)
 
</s> remove     def load_face_filter(self):
        """ Load faces to filter out of images """
        facefilter = None
        filter_files = [self.set_face_filter(filter_type)
                        for filter_type in ('filter', 'nfilter')]
 </s> add         abs_cos = abs(rotation_matrix[0, 0])
        abs_sin = abs(rotation_matrix[0, 1])
        rotated_width = int(height*abs_sin + width*abs_cos)
        rotated_height = int(height*abs_cos + width*abs_sin)
        rotation_matrix[0, 2] += rotated_width/2 - center[0]
        rotation_matrix[1, 2] += rotated_height/2 - center[1] </s> remove def WARNING(text):
    t = "%sWARNING%s " % (color_yellow, color_default) if Term_Support_Color() else "WARNING "
    print(t + __indent_text_block(text))

def ERROR(text):
    t = "%sERROR  %s " % (color_red, color_default) if Term_Support_Color() else "ERROR   "
    print(t + __indent_text_block(text))
 </s> add def __indent_text_block(text):
    """ Indent a text block """
    lines = text.splitlines()
    if len(lines) > 1:
        out = lines[0] + "\r\n"
        for i in range(1, len(lines)-1):
            out = out + "        " + lines[i] + "\r\n"
        out = out + "        " + lines[-1]
        return out
    return text


def term_support_color():
    """ Set whether OS Support terminal colour """
    global OS_VERSION
    return OS_VERSION[0] == "Linux" or OS_VERSION[0] == "Darwin"


def out_info(text):
    """ Format INFO Text """
    trm = "INFO    "
    if term_support_color():
        trm = "{}INFO   {} ".format(COLOR_GREEN, COLOR_DEFAULT)
    print(trm + __indent_text_block(text))


def out_warning(text):
    """ Format WARNING Text """
    trm = "WARNING "
    if term_support_color():
        trm = "{}WARNING{} ".format(COLOR_YELLOW, COLOR_DEFAULT)
    print(trm + __indent_text_block(text))


def out_error(text):
    """ Format ERROR Text """
    trm = "ERROR   "
    if term_support_color():
        trm = "{}ERROR  {} ".format(COLOR_RED, COLOR_DEFAULT)
    print(trm + __indent_text_block(text)) </s> remove         self.rotation_width = 0
        self.rotation_height = 0

    def get_rotation_angles(self):
        """ Set the rotation angles. Includes backwards compatibility for the
            'on' and 'off' options:
                - 'on' - increment 90 degrees
                - 'off' - disable
                - 0 is prepended to the list, as whatever happens, we want to
                  scan the image in it's upright state """
        rotation_angles = [0]

        if (not hasattr(self.args, 'rotate_images')
                or not self.args.rotate_images
                or self.args.rotate_images == "off"):
            return rotation_angles

        if self.args.rotate_images == "on":
            rotation_angles.extend(range(90, 360, 90))
        else:
            passed_angles = [int(angle)
                             for angle in self.args.rotate_images.split(",")]
            if len(passed_angles) == 1:
                rotation_step_size = passed_angles[0]
                rotation_angles.extend(range(rotation_step_size,
                                             360,
                                             rotation_step_size))
            elif len(passed_angles) > 1:
                rotation_angles.extend(passed_angles)

        return rotation_angles

    def get_already_processed(self):
        """ Return the images that already exist in the output directory """
        print("Output Directory: {}".format(self.args.output_dir))

        if (not hasattr(self.args, 'skip_existing')
                or not self.args.skip_existing):
            return None
 </s> add     def frames_count(self):
        """ Return current frames count """
        return len(self.data) </s> remove     def get_mtcnn_kwargs(self):
        """ Add the mtcnn arguments into a kwargs dictionary """
        mtcnn_threshold = [float(thr.strip())
                           for thr in self.args.mtcnn_threshold]
        return {"minsize": self.args.mtcnn_minsize,
                "threshold": mtcnn_threshold,
                "factor": self.args.mtcnn_scalefactor}
 </s> add     @staticmethod
    def get_original_rotation_matrix(dimensions, angle):
        """ Calculate original rotation matrix and invert """
        height, width = dimensions
        center = (width/2, height/2)
        rotation_matrix = cv2.getRotationMatrix2D(center, -1.0*angle, 1.) </s> remove     pnt_x = min([pnt[0] for pnt in rotated[0]])
    pnt_y = min([pnt[1] for pnt in rotated[0]])
    pnt_x1 = max([pnt[0] for pnt in rotated[0]])
    pnt_y1 = max([pnt[1] for pnt in rotated[0]])
    face.x = int(pnt_x)
    face.y = int(pnt_y)
    face.w = int(pnt_x1 - pnt_x)
    face.h = int(pnt_y1 - pnt_y)
    face.r = 0
    face.landmarksXY = [tuple(point) for point in rotated[1].tolist()]
 </s> add     pt_x = min([pnt[0] for pnt in rotated[0]])
    pt_y = min([pnt[1] for pnt in rotated[0]])
    pt_x1 = max([pnt[0] for pnt in rotated[0]])
    pt_y1 = max([pnt[1] for pnt in rotated[0]])

    if isinstance(face, DetectedFace):
        face.x = int(pt_x)
        face.y = int(pt_y)
        face.w = int(pt_x1 - pt_x)
        face.h = int(pt_y1 - pt_y)
        face.r = 0
        if len(rotated) > 1:
            face.landmarksXY = [tuple(point) for point in rotated[1].tolist()]
    elif isinstance(face, dict):
        face["x"] = int(pt_x)
        face["y"] = int(pt_y)
        face["w"] = int(pt_x1 - pt_x)
        face["h"] = int(pt_y1 - pt_y)
        face["r"] = 0
        if len(rotated) > 1:
            face["landmarksXY"] = [tuple(point)
                                   for point in rotated[1].tolist()]
    else:
        face = dlib.rectangle(int(pt_x), int(pt_y), int(pt_x1), int(pt_y1))

          0 - all logs shown
          1 - filter out INFO logs
          2 - filter out WARNING logs
          3 - filter out ERROR logs  """

  
      os.environ['TF_CPP_MIN_LOG_LEVEL'] = loglevel
      if loglevel != '0':
          for warncat in (FutureWarning, DeprecationWarning):
              warnings.simplefilter(action='ignore', category=warncat)
keep keep keep keep replace keep keep keep keep keep
 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 
lib/utils.py