ast finetuned audioset 10 10 0.4593
简介
核心亮点
- 基于 Transformer 架构,音频特征提取能力强
- 在 AudioSet 大规模数据集上微调,类别覆盖广
- 适用于环境音识别、音频事件自动打标
- BSD-3-Clause 协议,商业集成限制极少
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
tokenizer = AutoTokenizer.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download MIT/ast-finetuned-audioset-10-10-0.4593
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download MIT/ast-finetuned-audioset-10-10-0.4593 config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('MIT/ast-finetuned-audioset-10-10-0.4593')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('MIT/ast-finetuned-audioset-10-10-0.4593')
tokenizer = AutoTokenizer.from_pretrained('MIT/ast-finetuned-audioset-10-10-0.4593')
完整文档
---
license: bsd-3-clause
tags:
- audio-classification
---
Audio Spectrogram Transformer (fine-tuned on AudioSet)
Audio Spectrogram Transformer (AST) model fine-tuned on AudioSet. It was introduced in the paper AST: Audio Spectrogram Transformer by Gong et al. and first released in this repository.
Disclaimer: The team releasing Audio Spectrogram Transformer did not write a model card for this model so this model card has been written by the Hugging Face team.
Model description
The Audio Spectrogram Transformer is equivalent to ViT, but applied on audio. Audio is first turned into an image (as a spectrogram), after which a Vision Transformer is applied. The model gets state-of-the-art results on several audio classification benchmarks.
Usage
You can use the raw model for classifying audio into one of the AudioSet classes. See the documentation for more info.