              self.adjust_avg_color(old_face,new_face)
          if self.use_smooth_mask:
              self.smooth_mask(old_face,new_face)
  
          new_face = self.superpose(image, new_face, crop)
          original[slice(face_detected.y, face_detected.y + face_detected.h), slice(face_detected.x, face_detected.x + face_detected.w)] = cv2.resize(new_face, (face_detected.w, face_detected.h))
          return original
  
      def adjust_avg_color(self,img_old,img_new):
          w,h,c = img_new.shape
          for i in range(img_new.shape[-1]):
              old_avg = img_old[:, :, i].mean()
 
</s> remove     def adjust_avg_color(self,img_old,img_new):
        w,h,c = img_new.shape
        for i in range(img_new.shape[-1]):
            old_avg = img_old[:, :, i].mean()
            new_avg = img_new[:, :, i].mean()
 </s> add     @staticmethod
    def adjust_avg_color(old_face, new_face):
        """ Perform average color adjustment """
        for i in range(new_face.shape[-1]):
            old_avg = old_face[:, :, i].mean()
            new_avg = new_face[:, :, i].mean() </s> remove             self.smooth_mask(old_face,new_face)
 </s> add             self.smooth_mask(old_face, new_face)

        new_face = self.superpose(src_face, new_face, crop)
        new_image = frame.copy() </s> remove             self.adjust_avg_color(old_face,new_face)
 </s> add             self.adjust_avg_color(old_face, new_face) </s> remove             for m in range(img_new.shape[0]):
                for n in range(img_new.shape[1]):
                    temp = (img_new[m,n,i] + diff_int)
 </s> add             for int_h in range(new_face.shape[0]):
                for int_w in range(new_face.shape[1]):
                    temp = (new_face[int_h, int_w, i] + diff_int) </s> remove         face = cv2.resize(face, (size, size))
        face = numpy.expand_dims(face, 0)
        new_face = self.encoder(face / 255.0)[0]
        new_face = numpy.clip(new_face * 255, 0, 255).astype(image.dtype)
        new_face = cv2.resize(new_face, (160, 160))
 </s> add         process_face = cv2.resize(process_face,
                                  (size, size),
                                  interpolation=cv2.INTER_AREA)
        process_face = np.expand_dims(process_face, 0)

        new_face = self.encoder(process_face / 255.0)[0]
        new_face = np.clip(new_face * 255, 0, 255).astype(src_face.dtype)
        new_face = cv2.resize(
            new_face,
            (face_size - padding * 2, face_size - padding * 2),
            interpolation=cv2.INTER_CUBIC)
        cv2.warpAffine(
            new_face,
            detected_face.adjusted_matrix,
            (detected_face.frame_dims[1], detected_face.frame_dims[0]),
            new_image,
            flags=cv2.WARP_INVERSE_MAP | cv2.INTER_CUBIC,
            borderMode=cv2.BORDER_TRANSPARENT)
        return new_image
              self.adjust_avg_color(old_face,new_face)
          if self.use_smooth_mask:
              self.smooth_mask(old_face,new_face)
  
        cv2.warpAffine(
            new_face,
            detected_face.adjusted_matrix,
            (detected_face.frame_dims[1], detected_face.frame_dims[0]),
            new_image,
            flags=cv2.WARP_INVERSE_MAP | cv2.INTER_CUBIC,
            borderMode=cv2.BORDER_TRANSPARENT)
        return new_image
        cv2.warpAffine(
            new_face,
            detected_face.adjusted_matrix,
            (detected_face.frame_dims[1], detected_face.frame_dims[0]),
            new_image,
            flags=cv2.WARP_INVERSE_MAP | cv2.INTER_CUBIC,
            borderMode=cv2.BORDER_TRANSPARENT)
        return new_image
        cv2.warpAffine(
            new_face,
            detected_face.adjusted_matrix,
            (detected_face.frame_dims[1], detected_face.frame_dims[0]),
            new_image,
            flags=cv2.WARP_INVERSE_MAP | cv2.INTER_CUBIC,
            borderMode=cv2.BORDER_TRANSPARENT)
        return new_image
  
      def adjust_avg_color(self,img_old,img_new):
          w,h,c = img_new.shape
          for i in range(img_new.shape[-1]):
              old_avg = img_old[:, :, i].mean()
keep keep keep keep replace replace replace keep keep keep keep keep
 Fix convert-adjust (#531)

* Add dimensions to alignments + refactor

* Add frame_dims + funcs to DetectFaces. Add alignments lib

* Convert Adjust working

* Refactor and tidy up 
plugins/convert/Convert_Adjust.py