              placeholder = np.clip(placeholder, 0.0, 1.0)
          logger.trace("Got filename: '%s'. (placeholders: %s)",
                       predicted["filename"], placeholder.shape)
  
          return placeholder
  
      def pre_warp_adjustments(self, old_face, new_face, detected_face, predicted_mask):
          """ Run the pre-warp adjustments """
          logger.trace("old_face shape: %s, new_face shape: %s, predicted_mask shape: %s",
                       old_face.shape, new_face.shape,
 
</s> remove             placeholder = np.clip(placeholder, 0.0, 1.0)
 </s> add         np.clip(placeholder, 0.0, 1.0, out=placeholder) </s> remove     def post_warp_adjustments(self, predicted, new_image):
 </s> add     def post_warp_adjustments(self, background, new_image): </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         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             placeholder = cv2.warpAffine(  # pylint: disable=no-member
 </s> add             cv2.warpAffine(  # pylint: disable=no-member
        return placeholder, background
              placeholder = np.clip(placeholder, 0.0, 1.0)
          logger.trace("Got filename: '%s'. (placeholders: %s)",
                       predicted["filename"], placeholder.shape)
  
        return placeholder, background
  
      def pre_warp_adjustments(self, old_face, new_face, detected_face, predicted_mask):
          """ Run the pre-warp adjustments """
          logger.trace("old_face shape: %s, new_face shape: %s, predicted_mask shape: %s",
                       old_face.shape, new_face.shape,
keep keep keep keep replace keep keep keep keep keep
 Optimized numpy functions in Converter (#838) 
lib/convert.py