public abstract class BaseImageRecordReader
extends org.datavec.api.records.reader.BaseRecordReader
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendLabel |
protected int |
channels |
static String |
CHANNELS |
protected org.datavec.api.conf.Configuration |
conf |
static String |
CROP_IMAGE |
protected boolean |
cropImage |
protected File |
currentFile |
protected Map<String,String> |
fileNameMap |
protected int |
height |
static String |
HEIGHT |
protected boolean |
hitImage |
static String |
IMAGE_LOADER |
protected BaseImageLoader |
imageLoader |
protected ImageTransform |
imageTransform |
protected org.datavec.api.split.InputSplit |
inputSplit |
protected Iterator<File> |
iter |
protected org.datavec.api.io.labels.PathLabelGenerator |
labelGenerator |
protected List<String> |
labels |
protected double |
normalizeValue |
protected String |
pattern |
protected int |
patternPosition |
protected List<org.datavec.api.writable.Writable> |
record |
protected int |
width |
static String |
WIDTH |
| Constructor and Description |
|---|
BaseImageRecordReader() |
BaseImageRecordReader(int height,
int width,
int channels,
org.datavec.api.io.labels.PathLabelGenerator labelGenerator) |
BaseImageRecordReader(int height,
int width,
int channels,
org.datavec.api.io.labels.PathLabelGenerator labelGenerator,
ImageTransform imageTransform) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
accumulateLabel(String path)
Accumulate the label from the path
|
void |
close() |
protected boolean |
containsFormat(String format) |
org.datavec.api.conf.Configuration |
getConf() |
File |
getCurrentFile()
Returns the file loaded last by
next(). |
String |
getLabel(String path)
Get the label from the given path
|
List<String> |
getLabels() |
boolean |
hasNext() |
void |
initialize(org.datavec.api.conf.Configuration conf,
org.datavec.api.split.InputSplit split) |
void |
initialize(org.datavec.api.conf.Configuration conf,
org.datavec.api.split.InputSplit split,
ImageTransform imageTransform)
Called once at initialization.
|
void |
initialize(org.datavec.api.split.InputSplit split) |
void |
initialize(org.datavec.api.split.InputSplit split,
ImageTransform imageTransform)
Called once at initialization.
|
List<org.datavec.api.records.Record> |
loadFromMetaData(List<org.datavec.api.records.metadata.RecordMetaData> recordMetaDatas) |
org.datavec.api.records.Record |
loadFromMetaData(org.datavec.api.records.metadata.RecordMetaData recordMetaData) |
List<org.datavec.api.writable.Writable> |
next() |
org.datavec.api.records.Record |
nextRecord() |
int |
numLabels()
Returns
getLabels().size(). |
List<org.datavec.api.writable.Writable> |
record(URI uri,
DataInputStream dataInputStream) |
void |
reset() |
void |
setConf(org.datavec.api.conf.Configuration conf) |
void |
setCurrentFile(File currentFile)
Sets manually the file returned by
getCurrentFile(). |
void |
setLabels(List<String> labels) |
protected org.datavec.api.conf.Configuration conf
protected File currentFile
protected org.datavec.api.io.labels.PathLabelGenerator labelGenerator
protected boolean appendLabel
protected List<org.datavec.api.writable.Writable> record
protected boolean hitImage
protected int height
protected int width
protected int channels
protected boolean cropImage
protected ImageTransform imageTransform
protected BaseImageLoader imageLoader
protected org.datavec.api.split.InputSplit inputSplit
protected String pattern
protected int patternPosition
protected double normalizeValue
public static final String HEIGHT
public static final String WIDTH
public static final String CHANNELS
public static final String CROP_IMAGE
public static final String IMAGE_LOADER
public BaseImageRecordReader()
public BaseImageRecordReader(int height,
int width,
int channels,
org.datavec.api.io.labels.PathLabelGenerator labelGenerator)
public BaseImageRecordReader(int height,
int width,
int channels,
org.datavec.api.io.labels.PathLabelGenerator labelGenerator,
ImageTransform imageTransform)
protected boolean containsFormat(String format)
public void initialize(org.datavec.api.split.InputSplit split)
throws IOException
IOExceptionpublic void initialize(org.datavec.api.conf.Configuration conf,
org.datavec.api.split.InputSplit split)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void initialize(org.datavec.api.split.InputSplit split,
ImageTransform imageTransform)
throws IOException
split - the split that defines the range of records to readimageTransform - the image transform to use to transform images while loading themIOExceptionInterruptedExceptionpublic void initialize(org.datavec.api.conf.Configuration conf,
org.datavec.api.split.InputSplit split,
ImageTransform imageTransform)
throws IOException,
InterruptedException
conf - a configuration for initializationsplit - the split that defines the range of records to readimageTransform - the image transform to use to transform images while loading themIOExceptionInterruptedExceptionpublic List<org.datavec.api.writable.Writable> next()
public boolean hasNext()
public void close()
throws IOException
IOExceptionpublic void setConf(org.datavec.api.conf.Configuration conf)
public org.datavec.api.conf.Configuration getConf()
public String getLabel(String path)
path - the path to get the label fromprotected void accumulateLabel(String path)
path - the path to get the label frompublic void setCurrentFile(File currentFile)
getCurrentFile().public void reset()
public int numLabels()
getLabels().size().public List<org.datavec.api.writable.Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
IOExceptionpublic org.datavec.api.records.Record nextRecord()
public org.datavec.api.records.Record loadFromMetaData(org.datavec.api.records.metadata.RecordMetaData recordMetaData)
throws IOException
IOExceptionpublic List<org.datavec.api.records.Record> loadFromMetaData(List<org.datavec.api.records.metadata.RecordMetaData> recordMetaDatas) throws IOException
IOExceptionCopyright © 2016. All rights reserved.