audiobox aesthetics
Overview
Highlights
- Quantifies subjective audio quality and aesthetic appeal
- Automates quality filtering for generative audio pipelines
- Reduces reliance on manual human audio auditing
- Openly available under the flexible CC-BY-4.0 license
Usage
# Install Hugging Face transformers
pip install transformers torch
# Load model with transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("facebook/audiobox-aesthetics")
tokenizer = AutoTokenizer.from_pretrained("facebook/audiobox-aesthetics")
Hugging Face Download
We recommend downloading the model via the Hugging Face CLI or Hub SDK.
Guidance:Before downloading, install huggingface_hub with:
pip install -U huggingface_hub
CLI Download
Download the full repository
huggingface-cli download facebook/audiobox-aesthetics
Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download facebook/audiobox-aesthetics config.json --local-dir ./dir
See the official docs for more CLI options
SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('facebook/audiobox-aesthetics')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://huggingface.co/facebook/audiobox-aesthetics
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/facebook/audiobox-aesthetics
Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.
PyTorch / Transformers Usage
Install Transformers
pip install -U transformers torch
Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('facebook/audiobox-aesthetics')
tokenizer = AutoTokenizer.from_pretrained('facebook/audiobox-aesthetics')
Model Download
We recommend downloading the model via the ModelScope CLI or SDK.
Guidance:Before downloading, install ModelScope with:
pip install modelscope
CLI Download
Download the full repository
modelscope download --model facebook/audiobox-aesthetics
Download a single file to a local folder (e.g. README.md into ./dir)
modelscope download --model facebook/audiobox-aesthetics README.md --local_dir ./dir
See the docs for more CLI options
SDK Download
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('facebook/audiobox-aesthetics')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://www.modelscope.cn/facebook/audiobox-aesthetics.git
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/facebook/audiobox-aesthetics.git
ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。
Notebook Quickstart
Install the ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
Load the model and run inference
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
p = pipeline('text-generation', 'facebook/audiobox-aesthetics')
Full Documentation
---
license: cc-by-4.0
pipeline_tag: audio-classification
tags:
- model_hub_mixin
- pytorch_model_hub_mixin
---
This model has been pushed to the Hub using the PytorchModelHubMixin integration:
- Code: https://github.com/facebookresearch/audiobox-aesthetics
- Paper: https://huggingface.co/papers/2502.05139
--- README below copied from https://github.com/facebookresearch/audiobox-aesthetics
audiobox-aesthetics
 
Unified automatic quality assessment for speech, music, and sound.
- Blogpost ai.meta.com
<img src="assets/aes_model.png" alt="Model" height="400px">
Installation
1. Install via pip
pip install audiobox_aesthetics2. Install directly from source
This repository requires Python 3.9 and Pytorch 2.2 or greater. To install, you can clone this repo and run:
pip install -e .Pre-trained Models
Model | S3 | HuggingFace
|---|---|---|
All axes | checkpoint.pt | HF Repo
Usage
How to run prediction using CLI:
1. Create a jsonl files with the following format
{"path":"/path/to/a.wav"}
{"path":"/path/to/b.flac"}
...
{"path":"/path/to/z.wav"}or if you only want to predict aesthetic scores from certain timestamp
{"path":"/path/to/a.wav", "start_time":0, "end_time": 5}
{"path":"/path/to/b.flac", "start_time":3, "end_time": 10}and save it as
input.jsonl
2. Run following command
audio-aes input.jsonl --batch-size 100 > output.jsonlIf you haven't downloade the checkpoint, the script will try to download it automatically. Otherwise, you can provide the path by
--ckpt /path/to/checkpoint.pt
If you have SLURM, run the following command
audio-aes input.jsonl --batch-size 100 --remote --array 5 --job-dir $HOME/slurm_logs/ --chunk 1000 > output.jsonlPlease adjust CPU & GPU settings using
--slurm-gpu, --slurm-cpu depending on your nodes.
3. Output file will contain the same number of rows as input.jsonl. Each row contains 4 axes of prediction with a JSON-formatted dictionary. Check the following table for more info:
Axes name | Full name
|---|---|
CE | Content Enjoyment
CU | Content Usefulness
PC | Production Complexity
PQ | Production Quality
Output line example:
{"CE": 5.146, "CU": 5.779, "PC": 2.148, "PQ": 7.220}4. (Extra) If you want to extract only one axis (i.e. CE), post-process the output file with the following command using 1. Infer from file path Here, we show an example of how to read and re-map each annotation to the actual audio file. data_path | URLjq utility:
``jq '.CE' output.jsonl > output-aes_ce.txt``
### How to run prediction from Python script or interpreter
from audiobox_aesthetics.infer import initialize_predictor
predictor = initialize_predictor()
predictor.forward([{"path":"/path/to/a.wav"}, {"path":"/path/to/b.flac"}])2. Infer from torch tensor
from audiobox_aesthetics.infer import initialize_predictor
predictor = initialize_predictor()
wav, sr = torchaudio.load("/path/to/a.wav")
predictor.forward([{"path":wav, "sample_rate": sr}])## Evaluation dataset
We released our evaluation dataset consisting of 4 axes of aesthetic annotation scores.
{
"data_path": "/your_path/LibriTTS/train-clean-100/1363/139304/1363_139304_000011_000000.wav",
"Production_Quality": [8.0, 8.0, 8.0, 8.0, 8.0, 9.0, 8.0, 5.0, 8.0, 8.0],
"Production_Complexity": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"Content_Enjoyment": [8.0, 6.0, 8.0, 5.0, 8.0, 8.0, 8.0, 6.0, 8.0, 6.0],
"Content_Usefulness": [8.0, 6.0, 8.0, 7.0, 8.0, 9.0, 8.0, 6.0, 10.0, 7.0]
}1. Recognize the dataset name from data_path. In the example, it is LibriTTS.
2. Replace "/your_path/" into your downloaded LibriTTS directory.
3. Each axis contains 10 scores annotated by 10 different human annotators.
|---|---|
LibriTTS | https://openslr.org/60/
cv-corpus-13.0-2023-03-09 | https://commonvoice.mozilla.org/en/datasets
EARS | https://sp-uhh.github.io/ears_dataset/
MUSDB18 | https://sigsep.github.io/datasets/musdb.html
musiccaps | https://www.kaggle.com/datasets/googleai/musiccaps
(audioset) unbalanced_train_segments | https://research.google.com/audioset/dataset/index.html
PAM | https://zenodo.org/records/10737388License
The majority of audiobox-aesthetics is licensed under CC-BY 4.0, as found in the LICENSE file.
However, portions of the project are available under separate license terms: https://github.com/microsoft/unilm is licensed under MIT license.
Citation
If you found this repository useful, please cite the following BibTeX entry.