ImageDataset¶
A Dataset for ImageLists as input and ImageLists, Tables or Columns as output.
Parent type: Dataset<ImageList, O>
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputData |
ImageList |
The input ImageList | - |
outputData |
O |
The output data | - |
batchSize |
Int |
The batch size used for training | 1 |
shuffle |
Boolean |
Whether the data should be shuffled after each epoch of training | false |
Type parameters:
| Name | Upper Bound | Description | Default |
|---|---|---|---|
O |
Any? |
- | - |
Examples:
pipeline example {
val image = Image.fromFile("example.png");
val imageList = ImageList.fromImages([image]);
val labels = Column("label", ["example"]);
val dataset = ImageDataset(imageList, labels);
}
Stub code in ImageDataset.sdsstub
inputSize¶
Get the input ImageSize of this dataset.
Type: ImageSize
outputSize¶
Get the output size of this dataset.
Type: ImageSize
getInput¶
Get the input data of this dataset.
Results:
| Name | Type | Description |
|---|---|---|
input |
ImageList |
the input data of this dataset |
Examples:
pipeline example {
val image = Image.fromFile("example.png");
val imageList = ImageList.fromImages([image]);
val labels = Column("label", ["example"]);
val dataset = ImageDataset(imageList, labels);
val input = dataset.getInput();
}
Stub code in ImageDataset.sdsstub
getOutput¶
Get the output data of this dataset.
Results:
| Name | Type | Description |
|---|---|---|
output |
O |
the output data of this dataset |
Examples:
pipeline example {
val image = Image.fromFile("example.png");
val imageList = ImageList.fromImages([image]);
val labels = Column("label", ["example"]);
val dataset = ImageDataset(imageList, labels);
val output = dataset.getOutput();
}
Stub code in ImageDataset.sdsstub
shuffle¶
Return a new ImageDataset with shuffled data.
The original dataset is not modified.
Results:
| Name | Type | Description |
|---|---|---|
imageDataset |
ImageDataset<O> |
the shuffled ImageDataset |
Examples:
pipeline example {
val image = Image.fromFile("example.png");
val imageList = ImageList.fromImages([image]);
val labels = Column("label", ["example"]);
val dataset = ImageDataset(imageList, labels);
val shuffledDataset = dataset.shuffle();
}
split¶
Create two image datasets by splitting the data of the current dataset.
The first dataset contains a percentage of the data specified by percentage_in_first, and the second dataset
contains the remaining data. By default, the data is shuffled before splitting. You can disable this by setting
shuffle to False.
The original dataset is not modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percentageInFirst |
Float |
The percentage of data to include in the first dataset. Must be between 0 and 1. | - |
shuffle |
Boolean |
Whether to shuffle the data before splitting. | true |
Results:
| Name | Type | Description |
|---|---|---|
firstDataset |
ImageDataset<O> |
The first dataset. |
secondDataset |
ImageDataset<O> |
The second dataset. |