Chainer
stable

Tutorials

  • Chainer at a Glance
  • Concepts Walkthrough

Examples

  • Neural Net Examples
  • Colab Notebook Examples
  • Awesome Chainer

References

  • API Reference
    • Variable and Parameter
    • Functions
    • Link and Chains
      • Learnable connections
      • Activation/loss/normalization functions with parameters
      • Machine learning models
      • Pre-trained models
        • VGG Networks
        • GoogLeNet
        • Residual Networks
        • ChainerCV models
        • Compatibility with other frameworks
      • Link and Chain base classes
      • Link hooks
    • Probability Distributions
    • Optimizers
    • Weight Initializers
    • Snapshot Writers
    • Training Tools
    • Datasets
    • Iterator
    • Serializers
    • Backends and Devices
    • Utilities
    • Configuring Chainer
    • Debug Mode
    • Visualization of Computational Graph
    • Static Subgraph Optimizations: Usage
    • Static Subgraph Optimizations: Design Notes
    • Caffe Model Support
    • Assertion and Testing
  • Installation
  • ChainerX Documentation
  • Distributed Deep Learning with ChainerMN
  • Export Chainer to ONNX

Other

  • API Compatibility Policy
  • Contribution Guide
  • Tips and FAQs
  • Performance Best Practices
  • Upgrade Guide
  • License

Community

  • Slack Chat
  • Forums
Chainer
  • Docs »
  • API Reference »
  • Link and Chains »
  • chainer.links.model.vision.vgg.prepare
  • Edit on GitHub

chainer.links.model.vision.vgg.prepare¶

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

Converts the given image to the numpy array for VGG models.

Note that you have to call this method before forward because the pre-trained vgg 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 e9da1423.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: stable
Versions
latest
stable
v7.8.1
v7.8.0
v7.7.0
v7.4.0
v7.2.0
v7.1.0
v7.0.0
v6.7.0
v6.6.0
v6.5.0
v6.4.0
v6.3.0
v6.2.0
v6.1.0
v6.0.0
v6
v5.4.0
v5.3.0
v5.2.0
v5.1.0
v5.0.0
v4.5.0
v4.4.0
v4.3.1
v4.3.0
v4.2.0
v4.1.0
v4.0.0
v3.5.0
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.1.0
v2.0.2
v1.24.0
v1.23.0
v1.22.0
v1.21.0
v1.20.0.1
v1.19.0
v1.18.0
v1.17.0
v1.16.0
v1.15.0.1
v1.14.0
v1.13.0
v1.12.0
v1.11.0
v1.10.0
v1.9.1
v1.8.2
v1.7.2
v1.6.2.1
v1.5.1
v1.4.1
v1.3.2
v1.2.0
v1.1.2
v1.0.1
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.