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
TheAudioSeal class provides static methods to load pre-trained generator and detector models. It serves as the primary interface for model initialization in AudioSeal.
Methods
load_generator
Load a pre-trained AudioSeal watermark generator model.Parameters
Model card name or path to checkpoint. Can be:
- A local model card name (e.g., “audioseal_wm_16bits”)
- A path to a local checkpoint file
- A Hugging Face model path (e.g., “facebook/audioseal/generator_base.pth”)
- An HTTPS URL to a checkpoint
Number of bits for the watermark message. If not specified, uses the value from the model config.
Device to load the model on (e.g., “cpu”, “cuda”, “cuda:0”). If None, defaults to CPU.
Data type for model parameters (e.g., torch.float32, torch.float16). If None, uses default precision.
Returns
The loaded generator model ready for watermark generation.
Example
load_detector
Load a pre-trained AudioSeal watermark detector model.Parameters
Model card name or path to checkpoint. Can be:
- A local model card name (e.g., “audioseal_detector_16bits”)
- A path to a local checkpoint file
- A Hugging Face model path (e.g., “facebook/audioseal/detector_base.pth”)
- An HTTPS URL to a checkpoint
Number of bits for the watermark message. If not specified, uses the value from the model config.
Device to load the model on (e.g., “cpu”, “cuda”, “cuda:0”). If None, defaults to CPU.
Data type for model parameters (e.g., torch.float32, torch.float16). If None, uses default precision.
Returns
The loaded detector model ready for watermark detection.
Example
Notes
- Model checkpoints are cached in
~/.cache/audiosealby default - You can override the cache directory using the
AUDIOSEAL_CACHE_DIRenvironment variable - For Hugging Face models, the library will automatically handle authentication if needed
- Loading gated models requires the
huggingface_hubpackage installed
See Also
- AudioSealWM - Generator model class
- AudioSealDetector - Detector model class
- Quick Start Guide - Getting started with AudioSeal
