          new_face = np.clip(new_face, 0.0, 1.0)
          logger.trace("Got mask. Image shape: %s", new_face.shape)
          return new_face, raw_mask
  
      def post_warp_adjustments(self, predicted, new_image):
          """ Apply fixes to the image after warping """
          if self.adjustments["scaling"] is not None:
              new_image = self.adjustments["scaling"].run(new_image)
  
          if self.draw_transparent:
 
</s> remove         new_face = np.clip(new_face, 0.0, 1.0)
 </s> add         np.clip(new_face, 0.0, 1.0, out=new_face) </s> remove         return placeholder
 </s> add         return placeholder, background </s> remove         new_image = self.get_new_image(predicted, frame_size)
        patched_face = self.post_warp_adjustments(predicted, new_image)
 </s> add         new_image, background = self.get_new_image(predicted, frame_size)
        patched_face = self.post_warp_adjustments(background, new_image) </s> remove         patched_face = np.rint(patched_face * 255.0).astype("uint8")
 </s> add         patched_face *= 255.0
        patched_face = np.rint(
            patched_face,
            out=np.empty(patched_face.shape, dtype="uint8"),
            casting='unsafe'
        ) </s> remove             mask = np.repeat(new_image[:, :, -1][:, :, np.newaxis], 3, axis=-1)
            foreground = new_image[:, :, :3]
            background = (predicted["image"][:, :, :3] / 255.0) * (1.0 - mask)

 </s> add             foreground, mask = np.split(new_image, (3, ), axis=-1)
    def post_warp_adjustments(self, background, new_image):
          new_face = np.clip(new_face, 0.0, 1.0)
          logger.trace("Got mask. Image shape: %s", new_face.shape)
          return new_face, raw_mask
  
    def post_warp_adjustments(self, background, new_image):
          """ Apply fixes to the image after warping """
          if self.adjustments["scaling"] is not None:
              new_image = self.adjustments["scaling"].run(new_image)
  
          if self.draw_transparent:
keep keep keep keep replace keep keep keep keep keep
 Optimized numpy functions in Converter (#838) 
lib/convert.py