Missed TensorFlow World? Check out the recap. Learn more

tf.contrib.gan.eval.run_inception

View source on GitHub

Run images through a pretrained Inception classifier.

Aliases:

  • tf.contrib.gan.eval.classifier_metrics.run_inception
tf.contrib.gan.eval.run_inception(
    images,
    graph_def=None,
    default_graph_def_fn=_default_graph_def_fn,
    image_size=INCEPTION_DEFAULT_IMAGE_SIZE,
    input_tensor=INCEPTION_INPUT,
    output_tensor=INCEPTION_OUTPUT
)

Args:

  • images: Input tensors. Must be [batch, height, width, channels]. Input shape and values must be in [-1, 1], which can be achieved using preprocess_image.
  • graph_def: A GraphDef proto of a pretrained Inception graph. If None, call default_graph_def_fn to get GraphDef.
  • default_graph_def_fn: A function that returns a GraphDef. Used if graph_def is `None. By default, returns a pretrained InceptionV3 graph.
  • image_size: Required image width and height. See unit tests for the default values.
  • input_tensor: Name of input Tensor.
  • output_tensor: Name or list of output Tensors. This function will compute activations at the specified layer. Examples include INCEPTION_V3_OUTPUT and INCEPTION_V3_FINAL_POOL which would result in this function computing the final logits or the penultimate pooling layer.

Returns:

Tensor or Tensors corresponding to computed output_tensor.

Raises:

  • ValueError: If images are not the correct size.
  • ValueError: If neither graph_def nor default_graph_def_fn are provided.