Class CaptchaDataset
- java.lang.Object
-
- ai.djl.training.dataset.RandomAccessDataset
-
- ai.djl.basicdataset.cv.classification.CaptchaDataset
-
- All Implemented Interfaces:
ai.djl.training.dataset.Dataset
public class CaptchaDataset extends ai.djl.training.dataset.RandomAccessDataset
ADataset
featuring captcha images.Each image is a 160x60 grayscale image featuring 5 or 6 digits where each digit ranges from 0-10. The dataset therefore features 6 labels. Each label ranges from 0-11 where 0-10 represent a recognized digit and 11 indicates that the value is not a digit (size 5 and not 6).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CaptchaDataset.Builder
A builder for aCaptchaDataset
.
-
Field Summary
Fields Modifier and Type Field Description static int
CAPTCHA_LENGTH
static int
CAPTCHA_OPTIONS
static int
IMAGE_HEIGHT
static int
IMAGE_WIDTH
-
Constructor Summary
Constructors Constructor Description CaptchaDataset(CaptchaDataset.Builder builder)
Creates a new instance ofCaptchaDataset
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
availableSize()
static CaptchaDataset.Builder
builder()
Creates a builder to build aCaptchaDataset
.ai.djl.training.dataset.Record
get(ai.djl.ndarray.NDManager manager, long index)
void
prepare(ai.djl.util.Progress progress)
-
Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArray
-
-
-
-
Field Detail
-
IMAGE_WIDTH
public static final int IMAGE_WIDTH
- See Also:
- Constant Field Values
-
IMAGE_HEIGHT
public static final int IMAGE_HEIGHT
- See Also:
- Constant Field Values
-
CAPTCHA_LENGTH
public static final int CAPTCHA_LENGTH
- See Also:
- Constant Field Values
-
CAPTCHA_OPTIONS
public static final int CAPTCHA_OPTIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CaptchaDataset
public CaptchaDataset(CaptchaDataset.Builder builder)
Creates a new instance ofCaptchaDataset
.- Parameters:
builder
- a builder with the necessary configurations
-
-
Method Detail
-
builder
public static CaptchaDataset.Builder builder()
Creates a builder to build aCaptchaDataset
.- Returns:
- a new builder
-
get
public ai.djl.training.dataset.Record get(ai.djl.ndarray.NDManager manager, long index) throws java.io.IOException
- Specified by:
get
in classai.djl.training.dataset.RandomAccessDataset
- Throws:
java.io.IOException
-
availableSize
protected long availableSize()
- Specified by:
availableSize
in classai.djl.training.dataset.RandomAccessDataset
-
prepare
public void prepare(ai.djl.util.Progress progress) throws java.io.IOException
- Throws:
java.io.IOException
-
-