CSVImageDataset
Python template · sinapsis_data_readers.templates.image_readers.csv_dataset_reader
Overview
A dataset reader for CSV-based image datasets, inheriting from _BaseDataReader.
This class loads image data from a CSV file, processes the data into ImagePackets, and provides methods for reading the image data and handling the image processing.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
Terminalbash
pip install sinapsis-data-readers==1.0.0uv pip install sinapsis-data-readers==1.0.0uv add sinapsis-data-readers==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
width
The width of each image.
int
Optional
Default: 28
Optional
Default: 28
height
The height of each image.
int
Optional
Default: 28
Optional
Default: 28
pattern
str
Optional
Default: "**/*"
Optional
Default: "**/*"
data_dirRequired
str
Required
Default: null
Required
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
Optional
Default: null
root_dir
str | None
Optional
Default: null
Optional
Default: null
batch_size
int
Optional
Default: 1
Optional
Default: 1
color_space
sinapsis_core.data_containers.data_packet.ImageColor | None
Optional
Default: null
Optional
Default: null
load_on_init
bool
Optional
Default: false
Optional
Default: false
shuffle_data
bool
Optional
Default: false
Optional
Default: false
samples_to_load
int
Optional
Default: -1
Optional
Default: -1
Configuration example
Example from the Python docstring:
yaml
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: CSVImageDataset
class_name: CSVImageDataset
template_input: InputTemplate
attributes:
data_dir: '/path/to/data/dir'
pattern: '**/*'
batch_size: 1
shuffle_data: false
samples_to_load: -1
load_on_init: false
height: 28
width: 28Show schema-based configuration skeleton
yaml
templates:
- template_name: "CSVImageDataset"
class_name: "CSVImageDataset"
attributes:
width: 28
height: 28
pattern: "**/*"
data_dir: "<required>"
root_dir: null
batch_size: 1
color_space: null
load_on_init: false
shuffle_data: false
samples_to_load: -1
Inheritance
Immediate parent:
sinapsis_data_readers.templates.base_file_data_loader._BaseDataReaderEnvironment variables
Environment definitions belong to their canonical Python modules.