                                               cv2.INTER_AREA)
                                    for image in batch])
                          for size in self._output_sizes]
          logger.trace("Target image shapes: %s",
                       [tgt.shape for tgt_images in target_batch for tgt in tgt_images])
  
          retval = self._separate_target_mask(target_batch)
          logger.trace("Final targets: %s",
                       {k: v.shape if isinstance(v, np.ndarray) else [img.shape for img in v]
                        for k, v in retval.items()})
 
</s> remove                                   for image in batch])
 </s> add                                   for image in batch], dtype='float32') / 255. </s> remove                 padding)
 </s> add                 self.aligned["padding"]) </s> remove     def align_faces(self, detector_name, aligner_name, multiprocess):
 </s> add     def align_faces(self, detector_name, aligner_name, masker_name, multiprocess):
 </s> remove         # Random Warp
        if to_landmarks:
            warp_kwargs = dict(batch_src_points=batch_src_pts,
                               batch_dst_points=self._get_closest_match(filenames,
                                                                        side,
                                                                        batch_src_pts))
        else:
            warp_kwargs = dict()
        processed["feed"] = self._processing.warp(batch[..., :3], to_landmarks, **warp_kwargs)
 </s> add         # Random Warp # TODO change masks to have a input mask and a warped target mask
        processed["feed"] = [self._processing.warp(batch[..., :3],
                                                   self._training_opts["warp_to_landmarks"],
                                                   **warp_kwargs)] </s> remove             logger.trace("Batch has no mask")
            retval = dict(targets=batch)
 </s> add             masks = [np.ones((size_list_of_batches[-1].shape[:-1] + (1,)), dtype='float32')]
        retval = dict(targets=targets, masks=masks)
                     [tgt_images.shape[1:] for tgt_images in target_batch])
                                               cv2.INTER_AREA)
                                    for image in batch])
                          for size in self._output_sizes]
          logger.trace("Target image shapes: %s",
                     [tgt_images.shape[1:] for tgt_images in target_batch])
  
          retval = self._separate_target_mask(target_batch)
          logger.trace("Final targets: %s",
                       {k: v.shape if isinstance(v, np.ndarray) else [img.shape for img in v]
                        for k, v in retval.items()})
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/training_data.py