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
forwardbecause 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: - image (PIL.Image or numpy.ndarray) – Input image.
If an input is