LLM多模态•audiocraft•av(interfacing FFmpeg API)•Audio/Video/Bitstream•pytorch•sklearn•numpy•pandas•spacy•librosa•opencv
无论是ChatGPT、 LLM大语言模型、还是Meta公司的AI生成音乐,
都需要对 Audio、Video、Bitstream 进行处理。
Text的算法库 SpaCy, numpy, pytorch/Tensorflow/Transformers,…
Audio的算法库 librosa, numpy, pytorch/Tensorflow/Transformers, …;
Image/Video的算法库 Pillow, OpenCV, numpy, pytorch/Tensorflow/Transformers, …;
以Meta(Facebook已改名为Meta)开源的 audiocraft 为例:
- ASR(Audio转文本, 人机语音交互与识别)、
- TTS(文本合成语音)、
- NLP(自然语言处理)、
- NLG(自然语言生成)、
- Content Generation(智能生成 Text/Image/Audio/Video/…)
audiocraft 的:
- NLP 部分用的是Python库SpaCy;
- audio/video 部分用的是Python库 av(用 Cython 封装好FFmpeg C/C++ API),极大的方便 Audio/Video/Bitstream 的上层应用例如 AI/MachinLearning调用.
- 当然还可以参考Python的 OpenCV / av 库封装其它的多模态内容接口; 实现全媒体覆盖(Article/Text/Image/Audio/Video/…)
SpaCy: Industrial-Strength Natural Language Processing
https://spacy.io/
av 这个库(https://pypi.org/project/av/#description)
FFmpeg: https://ffmpeg.org/documentation.html
PyAV is a Pythonic binding for the [FFmpeg][ffmpeg] libraries.
We aim to provide all of the power and control of the underlying library, but manage the gritty details as much as possible.
PyAV is for direct and precise access to your media via containers, streams, packets, codecs, and frames.
It exposes a few transformations of that data, and helps you get your data to/from other packages (e.g. Numpy and Pillow).
This power does come with some responsibility as working with media is horrendously complicated and PyAV can't abstract it away or make all the best decisions for you.
If the `ffmpeg` command does the job without you bending over backwards, PyAV is likely going to be more of a hindrance than a help.
But where you can't work without it, PyAV is a critical tool.
Installation
------------
Due to the complexity of the dependencies, PyAV is not always the easiest Python package to install from source.
Since release 8.0.0 binary wheels are provided on [PyPI][pypi] for Linux, Mac and Windows linked against a modern FFmpeg.
You can install these wheels by running:
```bash
pip install av
```
If you want to use your existing FFmpeg, the source version of PyAV is on [PyPI][pypi] too:
```bash
pip install av --no-binary av
```
Alternative installation methods
--------------------------------
Another way of installing PyAV is via [conda-forge][conda-forge]:
```bash
conda install av -c conda-forge
```
https://github.com/abaelhe/audiocraft
Audiocraft is a PyTorch library for deep learning research on audio generation. At the moment, it contains the code for MusicGen, a state-of-the-art controllable text-to-music model.
MusicGen
Audiocraft provides the code and models for MusicGen, [a simple and controllable model for music generation][arxiv]. MusicGen is a single stage auto-regressive
Transformer model trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz. Unlike existing methods like MusicLM, MusicGen doesn't require a self-supervised semantic representation, and it generates
all 4 codebooks in one pass. By introducing a small delay between the codebooks, we show we can predict
them in parallel, thus having only 50 auto-regressive steps per second of audio.
Check out our [sample page][musicgen_samples] or test the available demo!
We use 20K hours of licensed music to train MusicGen. Specifically, we rely on an internal dataset of 10K high-quality music tracks, and on the ShutterStock and Pond5 music data.
Installation
Audiocraft requires Python 3.9, PyTorch 2.0.0, and a GPU with at least 16 GB of memory (for the medium-sized model). To install Audiocraft, you can run the following:
# Best to make sure you have torch installed first, in particular before installing xformers.
# Don't run this if you already have PyTorch installed.
pip install 'torch>=2.0'
# Then proceed to one of the following
pip install -U audiocraft # stable release
pip install -U git+https://git@github.com/facebookresearch/audiocraft#egg=audiocraft # bleeding edge
pip install -e . # or if you cloned the repo locally
</code>
<code>
Meta 开源音乐生成模型 MusicGen
2023-06-18 10:18 104
Meta 近日在 Github 上开源了其音乐生成模型 MusicGen。据介绍,MusicGen 主要用于音乐生成,它可以将文本和已有的旋律转化为完整乐曲。该模型基于谷歌 2017 年推出的 Transformer 模型。
研发团队表示:“我们使用了 20000 小时的授权音乐来训练该模型,并采用 Meta 的 EnCodec 编码器将音频数据分解为更小的单元进行并行处理,进而让 MusicGen 的运算效率和生成速度都比同类型 AI 模型更为出色。”
除此之外,MusicGen 还支持文本与旋律的组合输入,例如你可以提出生成 “一首轻快的曲目” 并同时要求 “将它与贝多芬的《欢乐颂》结合起来”。
研发团队还对 MusicGen 的实际表现进行了测试。结果显示,与谷歌的 MusicLM 以及 Riffusion、Mousai、Noise2Music 等其他音乐模型相比,MusicGen 在测试音乐与文本提示的匹配度以及作曲的可信度等指标上表现更好,总体而言略高于谷歌 MusicLM 的水平。
Meta 已允许该模型的商业使用,并在 Huggingface 上发布了一个供演示用的网页应用。
延伸阅读
谷歌推出 MusicLM,从文本生成音乐的模型
</code>
LLM多模态•audiocraft•av(interfacing FFmpeg API)•Audio/Video/Bitstream•pytorch•sklearn•numpy•pandas•spacy•librosa•opencv的更多相关文章
- [转载] FFmpeg API 变更记录
最近一两年内FFmpeg项目发展的速度很快,本来是一件好事.但是随之而来的问题就是其API(接口函数)一直在发生变动.这么一来基于旧一点版本的FFmpeg的程序的代码在最新的类库上可能就跑不通了. 例 ...
- FFmpeg API 变更记录
最近一两年内FFmpeg项目发展的速度很快,本来是一件好事.但是随之而来的问题就是其API(接口函数)一直在发生变动.这么一来基于旧一点版本的FFmpeg的程序的代码在最新的类库上可能就跑不通了. 例 ...
- ffmpeg api升级到3.3 api变化
void av_free_packet(AVPacket * pkt) Use void av_packet_unref(AVPacket * pkt) Wipe the packet. Unref ...
- 学习FFmpeg API
ffmpeg是编解码的利器,用了很久,以前看过dranger 的教程,非常精彩,受益颇多,是学习ffmpeg api很好的材料.可惜的是其针对的ffmpeg版本已经比较老了,而ffmpeg的更新又很快 ...
- 【转】学习FFmpeg API – 解码视频
ffmpeg是编解码的利器,用了很久,以前看过dranger 的教程,非常精彩,受益颇多,是学习ffmpeg api很好的材料.可惜的是其针对的ffmpeg版本已经比较老了,而ffmpeg的更新又很快 ...
- Expo大作战(二十六)--expo sdk api之Video和WebBrowser
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...
- [jPlayer] HTML5 Audio & Video for jQuery
---------------------------------------------------------------------------------------------------- ...
- with ffmpeg to encode video for live streaming and for recording to files for on-demand playback
We've been doing some experimentation with ffmpeg to encode video for live streaming and for recordi ...
- 使用HTML5抓取 Audio & Video
原文地址: http://www.html5rocks.com/en/tutorials/getusermedia/intro/ 本地化的文章: http://www.html5rocks.com/z ...
- The jQuery HTML5 Audio / Video Library (jQuery jPlayer插件给你的站点增加视频和音频功能)
http://jplayer.org/ The jQuery HTML5 Audio / Video Library jPlayer is the completely free and open s ...
随机推荐
- Asp.net core 少走弯路系列教程(四)JavaScript 学习
前言 新人学习成本很高,网络上太多的名词和框架,全部学习会浪费大量的时间和精力. 新手缺乏学习内容的辨别能力,本系列文章为新手过滤掉不适合的学习内容(比如多线程等等),让新手少走弯路直通罗马. 作者认 ...
- Quartz.Net定时任务
参照: [项目升级]集成Quartz.Net Job实现(一) - 腾讯云开发者社区-腾讯云 (tencent.com) Quartz分布式任务调度 - 掘金 (juejin.cn) 基本概念: Qu ...
- <HarmonyOS第一课02>DevEco Studio的使用
视频链接: https://developer.huawei.com/consumer/cn/training/course/slightMooc/C101717494752698457?ha_sou ...
- 工具 | todesk最新版设备代码、连接密码读取工具,附下载链接
工具介绍: todesk最新版读取设备代码.连接密码 工具 下载链接: 下载链接: todesk最新版读取设备代码.连接密码 工具下载 使用说明 工具使用效果如图
- 仿EXCEL插件,智表ZCELL产品V1.9 版本发布,增加导入、导出EXCEL功能
详细请移步 智表(ZCELL)官网www.zcell.net 更新说明 这次更新主要应用户要求,主要增加了导入.导出EXCEL文件功能,并增加了获取单元格公式.显示值等功能,欢迎大家体验使用. 本次 ...
- RPC实战与核心原理之异步RPC
异步RPC:压榨单机吞吐量 如何提升单机吞吐量 提升吞吐量,其实关键就两个字:"异步",提高CPU等资源的利用率 调用端如何异步 异步,最常用的方式就是返回 Future 对象的 ...
- C++ 智能指针的删除器
为什么要设置删除器 C++11 加入STL的 shared_ptr 和 unique_ptr,已经是我们编码的常客了.用的多自然就会了解到它们的删除器,比如很多C语言库(GDAL, GLFW, lib ...
- 记一次burp抓不到包的排查与处理
一次遇到了burp上奇怪的bug.访问某个页面显示 No response received from remote server , 但是使用 yakit 进行抓包之后发现网站可以正常抓包 ...
- RAG越来越不准?从Dify和ima知识库看元数据与标签如何让大模型更懂你
你是否有这样的经历:"知识库文档越来越多,知识库问答却越来越不靠谱,RAG检索到的都是一堆不相关的内容." 在这个信息爆炸的时代,我们不缺资料,缺的是找到"对的资料&qu ...
- .NET AI 生态关键拼图:全面解读 AI Extensions 和 Vector Extensions 如何重塑.NET开发生态
引言 关注.NET AI和.NET Vector原生开发已有半年之久了,其核心组件在历经这半年预发布期的持续迭代后,终于于5月16日和5月20日逐步发布了..在此之前,基于预发布版本撰写的文章和调试工 ...