public class NativeImageLoader extends BaseImageLoader
| Modifier and Type | Field and Description |
|---|---|
static String[] |
ALLOWED_FORMATS |
BASE_DIR, centerCropIfNeeded, channels, height, imageTransform, log, normalizeIfNeeded, normalizeValue, rng, width| Constructor and Description |
|---|
NativeImageLoader()
Loads images with no scaling or conversion.
|
NativeImageLoader(int height,
int width)
Instantiate an image with the given
height and width
|
NativeImageLoader(int height,
int width,
int channels)
Instantiate an image with the given
height and width
|
NativeImageLoader(int height,
int width,
int channels,
boolean centerCropIfNeeded)
Instantiate an image with the given
height and width
|
NativeImageLoader(int height,
int width,
int channels,
ImageTransform imageTransform)
Instantiate an image with the given
height and width
|
NativeImageLoader(int height,
int width,
int channels,
ImageTransform imageTransform,
double normalizeValue)
Instantiate an image with the given
height and width
|
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
asMatrix(File f) |
org.nd4j.linalg.api.ndarray.INDArray |
asMatrix(InputStream is) |
org.nd4j.linalg.api.ndarray.INDArray |
asMatrix(org.bytedeco.javacpp.opencv_core.Mat image) |
org.nd4j.linalg.api.ndarray.INDArray |
asRowVector(File f)
Convert a file to a row vector
|
org.nd4j.linalg.api.ndarray.INDArray |
asRowVector(InputStream is) |
org.nd4j.linalg.api.ndarray.INDArray |
asRowVector(org.bytedeco.javacpp.opencv_core.Mat image) |
protected org.bytedeco.javacpp.opencv_core.Mat |
centerCropIfNeeded(org.bytedeco.javacpp.opencv_core.Mat img) |
String[] |
getAllowedFormats() |
protected org.nd4j.linalg.api.ndarray.INDArray |
normalizeIfNeeded(org.nd4j.linalg.api.ndarray.INDArray image) |
protected org.bytedeco.javacpp.opencv_core.Mat |
scalingIfNeed(org.bytedeco.javacpp.opencv_core.Mat image) |
protected org.bytedeco.javacpp.opencv_core.Mat |
scalingIfNeed(org.bytedeco.javacpp.opencv_core.Mat image,
int dstHeight,
int dstWidth) |
downloadAndUntarpublic static final String[] ALLOWED_FORMATS
public NativeImageLoader()
public NativeImageLoader(int height,
int width)
height - the height to load*width - the width to loadpublic NativeImageLoader(int height,
int width,
int channels)
height - the height to loadwidth - the width to loadchannels - the number of channels for the image*public NativeImageLoader(int height,
int width,
int channels,
boolean centerCropIfNeeded)
height - the height to loadwidth - the width to loadchannels - the number of channels for the image*centerCropIfNeeded - to crop before rescaling and convertingpublic NativeImageLoader(int height,
int width,
int channels,
ImageTransform imageTransform)
height - the height to loadwidth - the width to loadchannels - the number of channels for the image*imageTransform - to use before rescaling and convertingpublic NativeImageLoader(int height,
int width,
int channels,
ImageTransform imageTransform,
double normalizeValue)
height - the height to loadwidth - the width to loadchannels - the number of channels for the image*imageTransform - to use before rescaling and convertingnormalizeValue - after rescaling and convertingpublic String[] getAllowedFormats()
getAllowedFormats in class BaseImageLoaderpublic org.nd4j.linalg.api.ndarray.INDArray asRowVector(File f) throws IOException
asRowVector in class BaseImageLoaderf - the image to convertIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asRowVector(InputStream is) throws IOException
asRowVector in class BaseImageLoaderIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asRowVector(org.bytedeco.javacpp.opencv_core.Mat image)
throws IOException
IOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asMatrix(File f) throws IOException
asMatrix in class BaseImageLoaderIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asMatrix(InputStream is) throws IOException
asMatrix in class BaseImageLoaderIOExceptionpublic org.nd4j.linalg.api.ndarray.INDArray asMatrix(org.bytedeco.javacpp.opencv_core.Mat image)
throws IOException
IOExceptionprotected org.nd4j.linalg.api.ndarray.INDArray normalizeIfNeeded(org.nd4j.linalg.api.ndarray.INDArray image)
protected org.bytedeco.javacpp.opencv_core.Mat centerCropIfNeeded(org.bytedeco.javacpp.opencv_core.Mat img)
protected org.bytedeco.javacpp.opencv_core.Mat scalingIfNeed(org.bytedeco.javacpp.opencv_core.Mat image)
protected org.bytedeco.javacpp.opencv_core.Mat scalingIfNeed(org.bytedeco.javacpp.opencv_core.Mat image,
int dstHeight,
int dstWidth)
Copyright © 2016. All rights reserved.