Chainer
v2.0.2
  • Installation Guide
  • Chainer Tutorial
  • Chainer Reference Manual
    • Core functionalities
    • Utilities
    • Assertion and Testing
    • Standard Function implementations
    • Standard Link implementations
      • Learnable connections
      • Activation/loss/normalization functions with parameters
      • Machine learning models
      • Pre-trained models
        • VGG16Layers
        • GoogLeNet
        • Residual Networks
    • Optimizers
    • Serializers
    • Function hooks
    • Weight Initializers
    • Dataset examples
    • Iterator examples
    • Trainer extensions
    • Trainer triggers
    • Caffe Reference Model Support
    • Visualization of Computational Graph
    • Environment variables
  • Upgrade Guide from v1 to v2
  • Contribution Guide
  • API Compatibility Policy
  • Tips and FAQs
  • Comparison with Other Frameworks
  • License
Chainer
  • Docs »
  • Chainer Reference Manual »
  • Standard Link implementations »
  • chainer.links.model.vision.googlenet.prepare
  • Edit on GitHub

chainer.links.model.vision.googlenet.prepare¶

chainer.links.model.vision.googlenet.prepare(image, size=(224, 224))[source]¶

Converts the given image to the numpy array for GoogLeNet.

Note that you have to call this method before __call__ because the pre-trained GoogLeNet model requires to resize the given image, covert the RGB to the BGR, subtract the mean, and permute the dimensions before calling.

Parameters:
  • image (PIL.Image or numpy.ndarray) – Input image. If an input is numpy.ndarray, its shape must be (height, width), (height, width, channels), or (channels, height, width), and the order of the channels must be RGB.
  • size (pair of ints) – Size of converted images. If None, the given image is not resized.
Returns:

The converted output array.

Return type:

numpy.ndarray

Next Previous

© Copyright 2015, Preferred Networks, inc. and Preferred Infrastructure, inc.. Revision 0f6e5bd1.

Built with Sphinx using a theme provided by Read the Docs.