              foreground = new_image[:, :, :3]
              background = (predicted["image"][:, :, :3] / 255.0) * (1.0 - mask)
  
              foreground *= mask
              frame = foreground + background
  
          np.clip(frame, 0.0, 1.0, out=frame)
          return frame
  
      def scale_image(self, frame):
          """ Scale the image if requested """
 
</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) </s> remove         return np.clip(frame, 0.0, 1.0)
 </s> add         np.clip(frame, 0.0, 1.0, out=frame)
        return frame </s> remove         placeholder = predicted["image"] / 255.0
        placeholder = np.concatenate((placeholder,
                                      np.zeros((frame_size[1], frame_size[0], 1))),
                                     axis=-1).astype("float32")
 </s> add         placeholder = np.zeros((frame_size[1], frame_size[0], 4), dtype="float32")
        background = predicted["image"] / np.array(255.0, dtype="float32")
        placeholder[:, :, :3] = background
 </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         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)
            background *= (1.0 - mask)
            background += foreground
            frame = background
              foreground = new_image[:, :, :3]
              background = (predicted["image"][:, :, :3] / 255.0) * (1.0 - mask)
  
              foreground *= mask
            background *= (1.0 - mask)
            background += foreground
            frame = background
            background *= (1.0 - mask)
            background += foreground
            frame = background
          np.clip(frame, 0.0, 1.0, out=frame)
          return frame
  
      def scale_image(self, frame):
          """ Scale the image if requested """
keep keep keep keep replace replace keep keep keep keep keep
 Optimized numpy functions in Converter (#838) 
lib/convert.py