public abstract class BaseImageLoader extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseImageLoader.MultiPageMode |
| Modifier and Type | Field and Description |
|---|---|
static String[] |
ALLOWED_FORMATS |
protected boolean |
centerCropIfNeeded |
protected long |
channels |
protected long |
height |
protected ImageTransform |
imageTransform |
protected BaseImageLoader.MultiPageMode |
multiPageMode |
protected Random |
rng |
protected long |
width |
| Constructor and Description |
|---|
BaseImageLoader() |
| Modifier and Type | Method and Description |
|---|---|
abstract Image |
asImageMatrix(File f)
As per
asMatrix(File) but as an Image |
abstract Image |
asImageMatrix(File f,
boolean nchw)
As per
asMatrix(File, boolean) but as an Image |
abstract Image |
asImageMatrix(InputStream inputStream)
As per
asMatrix(InputStream) but as an Image |
abstract Image |
asImageMatrix(InputStream inputStream,
boolean nchw)
As per
asMatrix(InputStream, boolean) but as an Image |
abstract INDArray |
asMatrix(File f)
As per
asMatrix(File, boolean) but NCHW/channels_first format |
abstract INDArray |
asMatrix(File f,
boolean nchw)
Load an image from a file to an INDArray
|
abstract INDArray |
asMatrix(InputStream inputStream) |
abstract INDArray |
asMatrix(InputStream inputStream,
boolean nchw)
Load an image file from an input stream to an INDArray
|
abstract INDArray |
asRowVector(File f) |
abstract INDArray |
asRowVector(InputStream inputStream) |
static void |
downloadAndUntar(Map urlMap,
File fullDir) |
String[] |
getAllowedFormats() |
public static final String[] ALLOWED_FORMATS
protected Random rng
protected long height
protected long width
protected long channels
protected boolean centerCropIfNeeded
protected ImageTransform imageTransform
protected BaseImageLoader.MultiPageMode multiPageMode
public String[] getAllowedFormats()
public abstract INDArray asRowVector(File f) throws IOException
IOExceptionpublic abstract INDArray asRowVector(InputStream inputStream) throws IOException
IOExceptionpublic abstract INDArray asMatrix(File f) throws IOException
asMatrix(File, boolean) but NCHW/channels_first formatIOExceptionpublic abstract INDArray asMatrix(File f, boolean nchw) throws IOException
f - File to load the image fromnchw - If true: return image in NCHW/channels_first [1, channels, height width] format; if false, return
in NHWC/channels_last [1, height, width, channels] formatIOExceptionpublic abstract INDArray asMatrix(InputStream inputStream) throws IOException
IOExceptionpublic abstract INDArray asMatrix(InputStream inputStream, boolean nchw) throws IOException
inputStream - Input stream to load the image fromnchw - If true: return image in NCHW/channels_first [1, channels, height width] format; if false, return
in NHWC/channels_last [1, height, width, channels] formatIOExceptionpublic abstract Image asImageMatrix(File f) throws IOException
asMatrix(File) but as an ImageIOExceptionpublic abstract Image asImageMatrix(File f, boolean nchw) throws IOException
asMatrix(File, boolean) but as an ImageIOExceptionpublic abstract Image asImageMatrix(InputStream inputStream) throws IOException
asMatrix(InputStream) but as an ImageIOExceptionpublic abstract Image asImageMatrix(InputStream inputStream, boolean nchw) throws IOException
asMatrix(InputStream, boolean) but as an ImageIOExceptionCopyright © 2022. All rights reserved.