Seraph Dataset Management Tool
A hot new dataset management tool that's crazy easy!
Motivation
There is no generally accepted metadata standard for multimedia data, and no tooling for multimedia dataset (meta)data management. At the outset of TEAM-ML, creating a training dataset was an error-prone process that typically required 8-20 hours of work from an ML expert, at a total cost of $1,200-$3,000.
To expedite the creation and refinement of training datasets, we developed an absolute minimum metadata standard for our multimedia datasets and a management tool that covers all our common use cases.
In our experience, it requires 0.5-3 hours to prepare a component dataset for Seraph management with a bespoke script. This is a non-recurring cost that depends on the original dataset format and the delta between that format and the Seraph format. Once all component datasets are configured, a training dataset can be assembled in 5-30 minutes, depending on (1) the user’s understanding of the tooling and the desired end composition and (2) whether the component dataset(s) can be copied in as-is or if the data needs to be resampled/resized/etc. Seraph is particularly useful for creating special-purpose or exploratory datasets from existing components; we were able to create a “9mm Parabellum Cartridge Dataset” at a cost of <$10.
Seraph currently supports only audio datasets, as anything else is out of scope for TEAM-ML.
Installation
You can install from PyPI pip:
pip install libseraph
Local Installation
conda create --name seraph python=3.12
conda activate seraph
pip install .
conda deactivate
Usage
The most used features of the Seraph tool are:
- Audio
- Import audio data from other datasets, including allowing class selection and exclusion
- Generate duration metadata
- Clip audio data to a set length while preserving original track identity data
- Resample audio
- Prune empty audio files
- Classes
- Switch class columns
- Rename, merge, regex merge, and drop classes by name
- Check class balance, including by fold/split
- Compose class metadata from existing column(s)
- Metadata
- Initialize a new seraph dataset
- Verify all data items against the dataset contract specified in the metadata file
- Provenance
- Prototype OpenIRIS integration for showing and submitting provenance
- Prune
- Remove records with no corresponding files and vice versa
- Drop data by row value
- Drop metadata columns
- Splits
- Automatically generate train/test/validate splits or cross-validation folds with respect to class balance and optionally avoid pseudoreplication
- Version
- Prototype dataset version management by at least one community standard
- Integrations -Prototype Fuel AI metadata format export
Examples
# Activate environment
conda activate seraph
# Initialize new dataset
seraph meta init
# Import audio datasets
seraph audio import --import_dir ~/Desktop/Kaggle_Gunshots/
seraph audio import --import_dir ~/Desktop/Cadre_Forensics/ --channel_merge_strat mix_down --sample_rate_merge_strat mix_down
# Switch classes from `gun_type` to `caliber`
seraph classes switch --new_class_col caliber --new_name_for_current_class_col gun_type
# Merge degenerate classes
seraph classes merge --target_class_name 9x19 --classes_to_merge "9mm Luger" --classes_to_merge "9mm"
# Add durations to columns and clip to 1 sec
seraph audio duration --metadata_column_conflict_strat replace
seraph audio clip --clip_duration_secs 1 --dry_run
# Show provenance data (WIP)
seraph prov show
seraph prov submit --activity_label "Make new gunshot dataset"
# Show verioning data (WIP)
seraph version show
# Cleanup
conda deactivate
Testing
# If needed, install test dependencies
# pip install .[coverage]
python3 -m coverage run -m unittest discover -s test -p "*_test.py" && python -m coverage report --skip-covered
python -m coverage html
Tests to Write
- No Coverage
- integrations
- provenance
- Partial Coverage
- meta
- version
Feature Wish-List
- IDEMPOTENCE
- Prevent a dataset from being "double-tapped"
- Pipe dreams
- Undo
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Ryan Quinn - Initial work
License
MIT.
Metadata
Release files for libseraph 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libseraph-0.3.3.tar.gz | 50.0 kB | Without provenance | Details for libseraph-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libseraph-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for libseraph-0.3.3-py3-none-any.whl |
Total release size: 108.2 kB
Release files / libseraph-0.3.3.tar.gz
| Download URL | libseraph-0.3.3.tar.gz |
|---|---|
| Size | 50.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5b96729b7d9a78e0d892335269e8265d4423fef6a1807ec2fc9acb253ce101f
|
|
BLAKE2b-256 checksum How to use checksums |
e70614434792ca2fc03362847cfbe5b903cd0a0ab658a7788bc5059e938bba01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / libseraph-0.3.3-py3-none-any.whl
| Download URL | libseraph-0.3.3-py3-none-any.whl |
|---|---|
| Size | 58.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30284475595043281ab1fdc80055abf5ddfe40db2acd99420598bf74a332941a
|
|
BLAKE2b-256 checksum How to use checksums |
e46f6b8be2627d1759ee967f4db274fc861e59bc4a21fc80eee512a6d31dc9d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for libseraph 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.