-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.0: support batch processing #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,45 @@ | ||
| # UNRELEASED | ||
| # Changelog | ||
|
|
||
| # 0.1.2 (January 6th, 2022) | ||
| All notable changes to this workspace will be documented in this file. | ||
|
|
||
| FEATURES | ||
| ## Unreleased | ||
|
|
||
| ## 0.2.0 - 2026-04-08 | ||
|
|
||
| ### `soundevents` | ||
|
|
||
| - Added `predict_raw_scores_batch_flat` and `predict_raw_scores_batch_into` for lower-allocation batched raw-score access. | ||
| - Expanded batched inference coverage with regression tests that verify flat and buffer-reuse paths against sequential inference. | ||
| - Removed redundant input validation in `classify_batch` while preserving the existing error behavior for invalid batches. | ||
| - Tightened crate metadata and docs.rs configuration so feature-gated APIs, including `Classifier::tiny`, render correctly on published docs. | ||
| - Added packaged third-party notices for bundled CED model artifacts. | ||
|
|
||
| ### `soundevents-dataset` | ||
|
|
||
| - Packaged the dual-license texts with the published crate and aligned crate metadata for docs.rs and crates.io discovery. | ||
| - Kept the crate on its Rust 1.59 / edition 2021 compatibility track while removing the in-source `deny(warnings)` footgun. | ||
| - Added packaged third-party notices for bundled AudioSet ontology and label metadata. | ||
|
|
||
| ### Workspace | ||
|
|
||
| - Included license files in published package contents for both crates. | ||
| - Upgraded README examples from ignored snippets to compile-checked doctests across the workspace. | ||
|
|
||
| ## 0.1.0 - 2026-04-08 | ||
|
|
||
| ### `soundevents` | ||
|
|
||
| - Initial public release of the ONNX Runtime wrapper for CED AudioSet classifiers. | ||
| - Added file, memory, and bundled-model loading paths plus configurable graph optimization. | ||
| - Added ranked top-k helpers, raw-score accessors, and chunked inference with mean/max aggregation. | ||
| - Added equal-length batch APIs for clip inference and chunked window batching for higher-throughput services. | ||
|
|
||
| ### `soundevents-dataset` | ||
|
|
||
| - Initial public release of the typed AudioSet dataset companion crate. | ||
| - Included both the 527-class rated label set and the full 632-entry ontology as `&'static` generated data. | ||
| - Kept the crate `no_std`-friendly, allocation-free at runtime, and compatible with Rust 1.59. | ||
|
|
||
| ### `xtask` | ||
|
|
||
| - Added code generation for the rated label set and ontology modules from upstream AudioSet source data. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,20 +22,25 @@ Production-oriented Rust inference for [CED](https://arxiv.org/abs/2308.11957) A | |||||
| - **Drop-in CED inference** — load any [CED](https://arxiv.org/abs/2308.11957) AudioSet ONNX model (or use the bundled `tiny` variant) and run it directly on `&[f32]` PCM samples. No Python, no preprocessing pipeline. | ||||||
| - **Typed labels, not bare integers** — every prediction comes back as an [`EventPrediction`] carrying a `&'static RatedSoundEvent` from [`soundevents-dataset`](./soundevents-dataset), so you get the canonical AudioSet name, the `/m/...` id, the model class index, and the confidence in one struct. | ||||||
| - **Compile-time class-count guarantee** — the `NUM_CLASSES = 527` constant comes from the rated dataset at codegen time. If a model returns the wrong number of classes you get a typed [`ClassifierError::UnexpectedClassCount`] instead of a silent mismatch. | ||||||
| - **Long-clip chunking built in** — `classify_chunked` / `classify_all_chunked` window the input at a configurable hop, run inference on each chunk, and aggregate the per-chunk confidences with either `Mean` or `Max`. Defaults match CED's 10 s training window (160 000 samples at 16 kHz). | ||||||
| - **Long-clip chunking built in** — `classify_chunked` / `classify_all_chunked` window the input at a configurable hop, run inference on each chunk, and aggregate the per-chunk confidences with either `Mean` or `Max`. Defaults match CED's 10 s training window (160 000 samples at 16 kHz), and fixed-size chunk batches can now be packed into one model call. | ||||||
| - **Top-k via a tiny min-heap** — `classify(samples, k)` does not allocate a full 527-element scores vector to find the top results. | ||||||
| - **Batch-ready low-level API** — `predict_raw_scores_batch`, `predict_raw_scores_batch_flat`, `predict_raw_scores_batch_into`, `classify_all_batch`, and `classify_batch` accept equal-length clip batches for service-layer batching. | ||||||
| - **Bring-your-own model or bundle one** — load from a path, from in-memory bytes, or enable the `bundled-tiny` feature to embed `models/tiny.onnx` directly into your binary. | ||||||
|
|
||||||
| ## Quick start | ||||||
|
|
||||||
| ```toml | ||||||
| [dependencies] | ||||||
| soundevents = "0.1" | ||||||
| soundevents = "0.2" | ||||||
| ``` | ||||||
|
|
||||||
| ```rust,ignore | ||||||
| ```rust,no_run | ||||||
| use soundevents::{Classifier, Options}; | ||||||
|
|
||||||
| fn load_mono_16k_audio(_: &str) -> Result<Vec<f32>, Box<dyn std::error::Error>> { | ||||||
| Ok(vec![0.0; 16_000]) | ||||||
| } | ||||||
|
|
||||||
| fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||||
| let mut classifier = Classifier::from_file("soundevents/models/tiny.onnx")?; | ||||||
|
||||||
| let mut classifier = Classifier::from_file("soundevents/models/tiny.onnx")?; | |
| let mut classifier = Classifier::from_file("path/to/model.onnx")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
0.1.0changelog entry claims “Added equal-length batch APIs…”, but those APIs are introduced in this PR alongside the0.2.0bump. This makes the release notes misleading; consider moving that bullet into0.2.0(or removing it from0.1.0) so each version’s section reflects what shipped in that release.