              logger.trace("batch shapes: %s, mask_batch shape: %s",
                           [tgt.shape for tgt in batch], mask_batch.shape)
              retval = dict(targets=batch, masks=mask_batch)
          else:
              logger.trace("Batch has no mask")
              retval = dict(targets=batch)
          return retval
  
      # <<< COLOR AUGMENTATION >>> #
      def color_adjust(self, batch):
          """ Perform color augmentation on the passed in batch.
 
</s> remove         batch = [tgt.astype("float32") / 255.0 for tgt in batch]
        if all(tgt.shape[-1] == 4 for tgt in batch):
            logger.trace("Batch contains mask")
            sizes = [item.shape[1] for item in batch]
            mask_batch = np.expand_dims(batch[sizes.index(max(sizes))][..., -1], axis=-1)
            batch = [item[..., :3] for item in batch]
            logger.trace("batch shapes: %s, mask_batch shape: %s",
                         [tgt.shape for tgt in batch], mask_batch.shape)
            retval = dict(targets=batch, masks=mask_batch)
 </s> add         targets = [batch[..., :3] for batch in size_list_of_batches]
        if size_list_of_batches[-1].shape[-1] == 4:
            masks = [size_list_of_batches[-1][..., 3:]] </s> remove                                   for image in batch])
 </s> add                                   for image in batch], dtype='float32') / 255. </s> remove         qname = "extract_align_out" if self.final_pass else "extract_align_in"
 </s> add         qname_dict = dict(detect="extract_align_in",
                          align="extract_mask_in",
                          mask="extract_mask_out")
        qname = "extract_mask_out" if self.final_pass else qname_dict[self.phase] </s> remove         if self._is_parallel or self.phase == "detect":
            qname = "extract_detect_in"
        else:
            qname = "extract_align_in"
 </s> add         qname_dict = dict(detect="extract_detect_in",
                          align="extract_align_in",
                          mask="extract_mask_in")
        qname = "extract_detect_in" if self._is_parallel else qname_dict[self.phase] </s> remove                      [tgt.shape for tgt_images in target_batch for tgt in tgt_images])
 </s> add                      [tgt_images.shape[1:] for tgt_images in target_batch])
            masks = [np.ones((size_list_of_batches[-1].shape[:-1] + (1,)), dtype='float32')]
        retval = dict(targets=targets, masks=masks)
              logger.trace("batch shapes: %s, mask_batch shape: %s",
                           [tgt.shape for tgt in batch], mask_batch.shape)
              retval = dict(targets=batch, masks=mask_batch)
          else:
            masks = [np.ones((size_list_of_batches[-1].shape[:-1] + (1,)), dtype='float32')]
        retval = dict(targets=targets, masks=masks)
            masks = [np.ones((size_list_of_batches[-1].shape[:-1] + (1,)), dtype='float32')]
        retval = dict(targets=targets, masks=masks)
          return retval
  
      # <<< COLOR AUGMENTATION >>> #
      def color_adjust(self, batch):
          """ Perform color augmentation on the passed in batch.
keep keep keep keep replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/training_data.py