deeptrack.sources.folder Module#
Utility class for data sources in a directory structure.
This module provies the ImageFolder DeepTrack2 class which enables control of image sources organized in a directory structure.
The primary usage is to facilitate naming and organizing of data sources.
Key Features#
Attribute Access
Enables accessing attributes tied to a data source such as paths, directory structure, length etc.
Labeling
Allows converting category names of images to integers, which is more flexible and easy to process in a data pipeline.
Category Splitting
The sources of images can be split into subcategories of which the user specifies the name of.
Module Structure#
ImageFolder: Data source for images organized in a directory structure.
Allows for processing of image sources with Dict data strucutres, splitting, naming and labeling functions.
Examples#
Print some information about a source of data:
>>> from deeptrack.sources import folder
>>> root = "data/train"
>>> data_source = folder.ImageFolder(root)
>>> print(f"Total images in training data: {len(train_data)}")
>>> print(f"Classes: {train_data.classes}")
Classes#
|
Data source for images organized in a directory structure. |
|
A class that represents one or more sources of data. |