(image_size, style_dataset_file, imagenet_data_dir)
return style_dataset, content_dataset
Generate calibration dataset from the training dataset.

  Args:
    image_size: int, image size to resize the training images to.
    style_dataset_file: str, path to the style images TFRecord file.
    imagenet_data_dir: str, path to the ImageNet data.

  Returns:
    (str, str) Path to the style dataset and content dataset for calibration.
Generate calibration dataset from the training dataset.
Generate calibration dataset from the training dataset .
def get_calibration_dataset(image_size, style_dataset_file, imagenet_data_dir):
  """Generate calibration dataset from the training dataset.

  Args:
    image_size: int, image size to resize the training images to.
    style_dataset_file: str, path to the style images TFRecord file.
    imagenet_data_dir: str, path to the ImageNet data.

  Returns:
    (str, str) Path to the style dataset and content dataset for calibration.
  """

  # Load style dataset
  style_dataset = tf.data.TFRecordDataset(style_dataset_file)
  style_dataset = style_dataset.map(parse_function(image_size, 'image_raw'),
                                    num_parallel_calls= \
                                    tf.data.experimental.AUTOTUNE)
  style_dataset = style_dataset.filter(rgb_filter_function)

  # Load content dataset
  tf_record_pattern = os.path.join(imagenet_data_dir, '%s-*' % 'train')
  data_files = tf.gfile.Glob(tf_record_pattern)
  content_dataset = tf.data.TFRecordDataset(data_files)
  content_dataset = content_dataset.map(
      parse_function(image_size, 'image/encoded'))
  content_dataset = content_dataset.filter(rgb_filter_function)

  return style_dataset, content_dataset
def get_calibration_dataset ( image_size , style_dataset_file , imagenet_data_dir ) : # Load style dataset style_dataset = tf . data . TFRecordDataset ( style_dataset_file ) style_dataset = style_dataset . map ( parse_function ( image_size , 'image_raw' ) , num_parallel_calls = tf . data . experimental . AUTOTUNE ) style_dataset = style_dataset . filter ( rgb_filter_function ) # Load content dataset tf_record_pattern = os . path . join ( imagenet_data_dir , '%s-*' % 'train' ) data_files = tf . gfile . Glob ( tf_record_pattern ) content_dataset = tf . data . TFRecordDataset ( data_files ) content_dataset = content_dataset . map ( parse_function ( image_size , 'image/encoded' ) ) content_dataset = content_dataset . filter ( rgb_filter_function ) return style_dataset , content_dataset