Synaesthesia 🧠🎨
Create general PyTorch data pipelines from simple Python, extendable to any sensors.
Overview 🌟
Synaesthesia is a Python library that forms the foundation of a dataset stack in any PyTorch/PyTorch Lightning projects. It contains base datasets and structures that enable combination, sequencing, concatenation, and other transformations through composition mechanisms.
This library provides a flexible and modular approach to creating datasets and dataloaders for various applications. It's designed to handle different data types, including CSV and image datasets, with the ability to expand functionality through custom classes.
Key Features 🔑
- Modular Design 🧩: Easily combine different dataset types and operations.
- Multi-modal Support 🎛️: Handle various sensor modalities and information types.
- Flexible Combinations 🔗:
- Parallel combination of datasets (MultiSignalDataset)
- Serial concatenation of datasets (ConcatDataset)
- Sequential data retrieval (SequentialDataset)
- Extensibility 🔌: Users can create custom dataset classes to extend functionality.
- Built-in Support 📦: Ready-to-use implementations for CSV and image datasets.
Installation 💻
The easiest way of using Synaesthesia is to clone it as a submodule of your system:
git submodule add git@github.com:danieledema/synaesthesia.git .submodules/synaesthesia
Then, use poetry to manage the required packages by including the submodule in the installation path:
poetry add .submodules/synaesthesia
Main Components 🧱
DatasetBase 🏗️
The foundation class for all datasets in the library.
CustomConcatDataset 🔗
Allows concatenation of multiple datasets, preserving individual dataset properties.
MultiSignalDataset 📡
Combines multiple single-signal datasets, supporting various aggregation and fill methods.
SequentialDataset 🔢
Enables retrieval of data sequences from a base dataset, with customizable filtering and stride options.
Filter Classes 🔍
Provides different strategies for data filtering and selection:
SkipNFilterMultipleNFilterExponentialFilter
Usage Examples 📚
# Example 1: Creating a multi-signal dataset
csv_dataset = CSVDataset(...)
image_dataset = ImageDataset(...)
multi_dataset = MultiSignalDataset([csv_dataset, image_dataset])
# Example 2: Creating a sequential dataset
seq_dataset = SequentialDataset(csv_dataset, n_samples=5, stride=2)
# Example 3: Concatenating datasets
concat_dataset = CustomConcatDataset([dataset1, dataset2, dataset3])
Extending the Library 🚀
Users can create custom dataset classes by inheriting from DatasetBase and implementing required methods:
class MyCustomDataset(DatasetBase):
def __init__(self, ...):
super().__init__()
# Custom initialization
def get_data(self, idx):
# Implement data retrieval logic
# Implement other required methods
Contributing 🤝
Contributions are welcome! Please feel free to submit a Pull Request.
License 📄
This project is licensed under the APACHE-2.0 License. See the LICENSE file for details.
Metadata
Release files for synaesthesia 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| synaesthesia-0.1.0.tar.gz | 69.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| synaesthesia-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.2 kB
Release files / synaesthesia-0.1.0.tar.gz
| Download URL | synaesthesia-0.1.0.tar.gz |
|---|---|
| Size | 69.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
734d009b9b33e9dc964fb3156d32b00ed3a15af3189595614fc632252f3bf83d
|
|
BLAKE2b-256 checksum How to use checksums |
abdae91248454e8db620a8e950862e60523f83d6f5dd598bc1528b2dee8ec428
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.27
|
Release files / synaesthesia-0.1.0-py3-none-any.whl
| Download URL | synaesthesia-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
388308b1fb97c217a3c9989637315835adfaa4256722d94d52df18ddb4258353
|
|
BLAKE2b-256 checksum How to use checksums |
31f12f3091efe02d2b4df1df6191cb6d2812f1064884bf1d9048dda2cf5429f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.27
|