Expand description
§birdnet-onnx
A Rust library for running inference on BirdNET and Perch ONNX models.
§Supported Models
BirdNETv2.4: 48kHz, 3s segments (144,000 samples)BirdNETv3.0: 32kHz, 5s segments (160,000 samples)Perchv2: 32kHz, 5s segments (160,000 samples)
§Example
ⓘ
use birdnet_onnx::Classifier;
let classifier = Classifier::builder()
.model_path("model.onnx")
.labels_path("labels.txt")
.with_cuda()
.build()?;
let result = classifier.predict(&audio_segment)?;
for pred in &result.predictions {
println!("{}: {:.1}%", pred.species, pred.confidence * 100.0);
}Re-exports§
pub use execution_providers::available_execution_providers;pub use tensorrt_config::TensorRTConfig;
Modules§
- execution_
providers - Execution provider availability detection.
- ort_
execution_ providers ExecutionProviders provide hardware acceleration toSessions.- tensorrt_
config TensorRTexecution provider configuration
Structs§
- Classifier
- Thread-safe classifier for bird species detection
- Classifier
Builder - Builder for constructing a Classifier
- Location
Score - Species probability score from meta model based on location and date.
- Model
Config - Model configuration derived from detected model type.
- Prediction
- Single species prediction.
- Prediction
Result - Complete inference result.
- Range
Filter - Thread-safe range filter for location-based species filtering
- Range
Filter Builder - Builder for constructing a
RangeFilter
Enums§
- Error
- Errors that can occur during classifier operations.
- Execution
Provider Info - Information about execution providers (hardware backends).
- Label
Format - Expected label format per model type.
- Model
Type - Supported model types.
Functions§
- calculate_
week - Calculate week number for
BirdNETmeta model (48-week year, 4 weeks per month). - init_
runtime - Initialize ONNX Runtime with auto-detected library path.
- validate_
coordinates - Validate geographic coordinates.
- validate_
date - Validate date parameters for
BirdNETcalendar.
Type Aliases§
- Result
- Result type alias using [
Error].