Documentation Index
Fetch the complete documentation index at: https://mintlify.com/facebookresearch/audioseal/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheAudioSealDetector class detects the presence of AudioSeal watermarks in audio signals and decodes embedded secret messages. It returns detection probabilities and binary messages.
Initialization
Typically, you’ll load a detector using
AudioSeal.load_detector() rather than instantiating directly.Methods
detect_watermark
Detect watermark presence and decode the embedded message in one convenient call.Parameters
Input audio tensor of shape
(batch, channels, samples) or (batch, samples). The audio should be at the model’s expected sample rate (typically 16kHz).Sample rate of the input audio. This parameter is deprecated and will be ignored in AudioSeal 0.2+.
Threshold for converting message probabilities to binary values. Probabilities above this threshold are set to 1, below to 0.
Threshold for frame-level watermark detection. Used to compute the overall detection probability.
Returns
Detection probability tensor of shape
(batch,). Values range from 0.0 to 1.0, indicating the proportion of frames detected as watermarked.Binary message tensor of shape
(batch, nbits). Each value is 0 or 1. If the audio is not watermarked, the message will be essentially random.Example
decode_message
Decode the message from raw detector output.Parameters
Raw watermark result tensor of shape
(batch, nbits, frames) from the detector output.Returns
Decoded message probabilities of shape
(batch, nbits). Values range from 0.0 to 1.0 after sigmoid activation, indicating the probability of each bit being 1.Example
forward
Run the full detection pipeline, returning both detection scores and decoded messages.Parameters
Input audio tensor of shape
(batch, channels, samples) or (batch, samples).Sample rate of the input audio. This parameter is deprecated and will be ignored.
Returns
Detection result tensor of shape
(batch, 2, frames). The first channel contains the probability of no watermark, the second channel contains the probability of watermark presence at each frame. Values are softmax-normalized.Decoded message probabilities of shape
(batch, nbits). Values range from 0.0 to 1.0.Example
Attributes
The detection network consisting of a SEANetEncoder followed by a 1x1 convolution layer.
Optional normalizer that applies loudness normalization before detection for improved robustness.
Number of bits in the secret message. Set to 0 for 0-bit watermarking (presence detection only).
Complete Example
Advanced Usage
Batch Processing
Localized Detection
See Also
- AudioSeal - Model loader
- AudioSealWM - Watermark generator
- NormalizationProcessor - Audio normalization
- Detection Concepts - Detection best practices
