          mask[h//15:-h//15,w//15:-w//15,:] = 255
          mask = cv2.GaussianBlur(mask,(15,15),10)
          img_new[crop,crop] = mask/255*img_new + (1-mask/255)*img_old
  
      def superpose(self,image, new_face, crop):
          new_image = image.copy()
          new_image[crop, crop] = new_face
          return new_image
 
</s> remove     def smooth_mask(self,img_old,img_new):
        w,h,c = img_new.shape
        crop = slice(0,w)
        mask = numpy.zeros_like(img_new)
        mask[h//15:-h//15,w//15:-w//15,:] = 255
        mask = cv2.GaussianBlur(mask,(15,15),10)
        img_new[crop,crop] = mask/255*img_new + (1-mask/255)*img_old
 </s> add     @staticmethod
    def smooth_mask(old_face, new_face):
        """ Smooth the mask """
        width, height, _ = new_face.shape
        crop = slice(0, width)
        mask = np.zeros_like(new_face)
        mask[height // 15:-height // 15, width // 15:-width // 15, :] = 255
        mask = cv2.GaussianBlur(mask,  # pylint: disable=no-member
                                (15, 15),
                                10)
        new_face[crop, crop] = (mask / 255 * new_face +
                                (1 - mask / 255) * old_face) </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         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
 </s> add         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 </s> remove             self.adjust_avg_color(old_face,new_face)
 </s> add             self.adjust_avg_color(old_face, new_face) </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)
    @staticmethod
    def superpose(src_face, new_face, crop):
        """ Crop Face """
        new_image = src_face.copy()
          mask[h//15:-h//15,w//15:-w//15,:] = 255
          mask = cv2.GaussianBlur(mask,(15,15),10)
          img_new[crop,crop] = mask/255*img_new + (1-mask/255)*img_old
  
    @staticmethod
    def superpose(src_face, new_face, crop):
        """ Crop Face """
        new_image = src_face.copy()
    @staticmethod
    def superpose(src_face, new_face, crop):
        """ Crop Face """
        new_image = src_face.copy()
          new_image[crop, crop] = new_face
          return new_image
keep keep keep keep replace replace 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