🚀 オーディオボックス美観評価モデル
このモデルは、音声、音楽、音の統一的な自動品質評価を行うことができます。
🚀 クイックスタート
このモデルは、PytorchModelHubMixin を使用してハブに公開されています。
- コード: https://github.com/facebookresearch/audiobox-aesthetics
- 論文: https://huggingface.co/papers/2502.05139
✨ 主な機能
- 音声、音楽、音の統一的な自動品質評価を行うことができます。
- 4つの軸(Content Enjoyment、Content Usefulness、Production Complexity、Production Quality)での予測が可能です。
📦 インストール
pipを使用したインストール
pip install audiobox_aesthetics
ソースからの直接インストール
このリポジトリはPython 3.9とPytorch 2.2以上が必要です。インストールするには、このリポジトリをクローンして以下のコマンドを実行します。
pip install -e .
📚 ドキュメント
事前学習済みモデル
💻 使用例
基本的な使用法
CLIを使用した予測の実行方法
- 以下の形式のjsonlファイルを作成します。
{"path":"/path/to/a.wav"}
{"path":"/path/to/b.flac"}
...
{"path":"/path/to/z.wav"}
または、特定のタイムスタンプからの美観スコアを予測する場合は、以下のようにします。
{"path":"/path/to/a.wav", "start_time":0, "end_time": 5}
{"path":"/path/to/b.flac", "start_time":3, "end_time": 10}
そして、input.jsonl
として保存します。
- 以下のコマンドを実行します。
audio-aes input.jsonl --batch-size 100 > output.jsonl
チェックポイントをダウンロードしていない場合は、スクリプトが自動的にダウンロードしようとします。それ以外の場合は、--ckpt /path/to/checkpoint.pt
でパスを指定できます。
SLURMを使用している場合は、以下のコマンドを実行します。
audio-aes input.jsonl --batch-size 100 --remote --array 5 --job-dir $HOME/slurm_logs/ --chunk 1000 > output.jsonl
ノードに応じて --slurm-gpu, --slurm-cpu
を使用してCPUとGPUの設定を調整してください。
- 出力ファイルには、
input.jsonl
と同じ行数が含まれます。各行には、JSON形式の辞書で表された4つの軸の予測結果が含まれます。詳細は以下の表を参照してください。
軸名 |
完全名 |
CE |
Content Enjoyment |
CU |
Content Usefulness |
PC |
Production Complexity |
PQ |
Production Quality |
出力行の例:
{"CE": 5.146, "CU": 5.779, "PC": 2.148, "PQ": 7.220}
- (追加)特定の軸(例: CE)のみを抽出する場合は、
jq
ユーティリティを使用して以下のコマンドで出力ファイルを後処理します。
jq '.CE' output.jsonl > output-aes_ce.txt
Pythonスクリプトまたはインタープリターからの予測の実行方法
- ファイルパスからの推論
from audiobox_aesthetics.infer import initialize_predictor
predictor = initialize_predictor()
predictor.forward([{"path":"/path/to/a.wav"}, {"path":"/path/to/b.flac"}])
- torchテンソルからの推論
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}])
評価データセット
私たちは、4つの軸の美観アノテーションスコアからなる評価データセットを公開しています。
ここでは、各アノテーションを実際のオーディオファイルに読み取り、再マッピングする方法の例を示します。
{
"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]
}
- data_pathからデータセット名を認識します。この例では、LibriTTSです。
- "/your_path/" をダウンロードしたLibriTTSディレクトリに置き換えます。
- 各軸には、10人の異なる人間のアノテーターによって付けられた10個のスコアが含まれています。
データパス |
URL |
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/10737388 |
📄 ライセンス
オーディオボックス美観評価モデルの大部分は、LICENSEファイルに記載されているようにCC-BY 4.0でライセンスされています。ただし、プロジェクトの一部は別のライセンス条項で利用可能です。https://github.com/microsoft/unilm はMITライセンスです。
引用
このリポジトリが役に立った場合は、以下のBibTeXエントリを引用してください。
@article{tjandra2025aes,
title={Meta Audiobox Aesthetics: Unified Automatic Quality Assessment for Speech, Music, and Sound},
author={Andros Tjandra and Yi-Chiao Wu and Baishan Guo and John Hoffman and Brian Ellis and Apoorv Vyas and Bowen Shi and Sanyuan Chen and Matt Le and Nick Zacharov and Carleigh Wood and Ann Lee and Wei-Ning Hsu},
year={2025},
url={https://arxiv.org/abs/2502.05139}
}
謝辞
モデルコードの一部は、https://github.com/microsoft/unilm/tree/master/wavlm からコピーされています。