public abstract class BaseImageRecordReader extends Object implements org.canova.api.records.reader.RecordReader
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendLabel |
protected int |
channels |
static String |
CHANNELS |
protected org.canova.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 org.canova.api.split.InputSplit |
inputSplit |
protected Iterator<File> |
iter |
List<String> |
labels |
protected String |
pattern |
protected int |
patternPosition |
protected Collection<org.canova.api.writable.Writable> |
record |
protected int |
width |
static String |
WIDTH |
| Constructor and Description |
|---|
BaseImageRecordReader() |
BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel) |
BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel,
List<String> labels) |
BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel,
List<String> labels,
String pattern,
int patternPosition) |
BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel,
String pattern,
int patternPosition) |
BaseImageRecordReader(int height,
int width,
int channels,
List<String> labels) |
| 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.canova.api.conf.Configuration |
getConf() |
File |
getCurrentFile() |
String |
getLabel(String path)
Get the label from the given path
|
List<String> |
getLabels() |
boolean |
hasNext() |
void |
initialize(org.canova.api.conf.Configuration conf,
org.canova.api.split.InputSplit split) |
void |
initialize(org.canova.api.split.InputSplit split) |
Collection<org.canova.api.writable.Writable> |
next() |
int |
numLabels() |
Collection<org.canova.api.writable.Writable> |
record(URI uri,
DataInputStream dataInputStream) |
void |
reset() |
void |
setConf(org.canova.api.conf.Configuration conf) |
void |
setCurrentFile(File currentFile) |
protected org.canova.api.conf.Configuration conf
protected File currentFile
protected boolean appendLabel
protected Collection<org.canova.api.writable.Writable> record
protected boolean hitImage
protected int height
protected int width
protected int channels
protected boolean cropImage
protected BaseImageLoader imageLoader
protected org.canova.api.split.InputSplit inputSplit
protected String pattern
protected int patternPosition
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,
List<String> labels)
public BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel)
public BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel,
List<String> labels)
public BaseImageRecordReader(int height,
int width,
int channels,
boolean appendLabel,
String pattern,
int patternPosition)
protected boolean containsFormat(String format)
public void initialize(org.canova.api.split.InputSplit split)
throws IOException
initialize in interface org.canova.api.records.reader.RecordReaderIOExceptionpublic void initialize(org.canova.api.conf.Configuration conf,
org.canova.api.split.InputSplit split)
throws IOException,
InterruptedException
initialize in interface org.canova.api.records.reader.RecordReaderIOExceptionInterruptedExceptionpublic Collection<org.canova.api.writable.Writable> next()
next in interface org.canova.api.records.reader.RecordReaderpublic boolean hasNext()
hasNext in interface org.canova.api.records.reader.RecordReaderpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setConf(org.canova.api.conf.Configuration conf)
setConf in interface org.canova.api.conf.Configurablepublic org.canova.api.conf.Configuration getConf()
getConf in interface org.canova.api.conf.Configurablepublic String getLabel(String path)
path - the path to get the label fromprotected void accumulateLabel(String path)
path - the path to get the label frompublic File getCurrentFile()
public void setCurrentFile(File currentFile)
public List<String> getLabels()
getLabels in interface org.canova.api.records.reader.RecordReaderpublic void reset()
reset in interface org.canova.api.records.reader.RecordReaderpublic int numLabels()
public Collection<org.canova.api.writable.Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
record in interface org.canova.api.records.reader.RecordReaderIOExceptionCopyright © 2016. All rights reserved.