DAIN插帧算法
连手机都开始用上120帧的显示屏,但是网上大部分的视频还是24帧。
视频的帧率已经远远赶不上人民群众的需求了,所以有不少人都在研究如何把普通视频变成高帧率视频。
去年,英伟达开源了Super SloMo,从普通的视频“脑补”出高帧率的画面,从30fps插帧到240fps,即使放慢8倍也不会感到卡顿。
最近,来自上海交大的一个新的插帧算法DAIN开源。它比英伟达的算法效果更清晰、帧率更高,可以把30fps的进一步插帧到480fps,这已经超过了很多手机的慢动作录像帧率。
更重要的是,英伟达的Super SloMo只用在了真实拍摄的视频上,而这项研究却可以扩展到常见的任何类型视频:电影、定格动画、
动画卡通等等。
△ 连埼玉老师的披风都变得丝滑流畅了
如果你觉得上面效果还不够明显,可以再看一张。
羽毛的摆动是不是变得更流畅自然了?
可以想象,如果未来把DAIN用于动画的制作,只要用低帧的动画就可以生成丝滑的效果,或许能大大减少插画师的工作。
DAIN的代码已经开源,甚至研究人员还打包了一份Windows安装程序,即使没有任何AI基础的用户也可以直接拿来用。
安装
Windows系统的用户有现成的exe文件安装(地址见文末),不过现在仍处于Alpha阶段,软件可能存在一定的不稳定性。
其他平台的用户安装起来也不复杂。
首先确保你的PyTorch版本不低于1.0.0,将项目克隆到本地:
git clone https://github.com/baowenbo/DAIN.git
安装PyTorch的各个扩展包:
cd DAIN
cd my_package
./build.sh
还要安装英伟达预测光流网络PWCNet的软件包:
cd ../PWCNet/correlation_package_pytorch1_0
./build.sh
由于作者已经提供了预训练模型,我们不必再花费大量精力去训练。创建目录model_weights,并且将预训练模型的权重下载到相应的文件夹中:
cd model_weights
wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/best.pth
运行命令以下命令,就可以开始给视频插帧啦!
CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py —netName DAIN_slowmotion —time_step 0.25
—time_step之后的参数就是视频的放慢倍数,0.25代表视频帧率扩展为原来的4倍。如果要生成8x和10x慢动作,参数就改成0.125和0.1,依此类推。
深度加光流,图像更清晰
之前已经有很多给视频插帧的算法,DAIN和它们有什么不同呢?
DAIN的全称是Depth-Aware Video Frame Interpolation,即深度感知视频帧插值。
视频帧插值的目的是在原始帧之间合成不存在的帧。但是由于大的物体运动或遮挡,插帧的质量通常会比较低。
在这篇研究中,研究人员提出了一种通过探索深度信息来检测遮挡的方法。
具体来说,作者开发了一个深度感知光流投影层来合成中间流,中间流对较远的对象进行采样。此外,学习分层功能以从相邻像素收集上下文信息。
上图是DAIN的体系架构:给定两个时刻的输入帧,先估计光流和深度图,然后使用建议的深度感知流投影层生成中间流。
然后,模型基于光流和局部插值内核对输入帧、深度图和上下文特征进行扭曲,合成输出帧。
这种模型紧凑、高效且完全可微分。定量和定性的结果表明,DAIN在各种数据集上均优于最新的帧插值方法。
作者
这篇文章的第一作者Bao Wenbo,是上海交通大学电子信息与电气工程学院的博士生。
他目前的研究领域集中在图像/视频处理,计算机视觉和机器学习。另外在硬件设计、嵌入式系统和并行编程方面也很有经验。
参考资料
【1】论文地址:
https://sites.google.com/view/wenbobao/dain
【2】项目地址:
https://github.com/baowenbo/DAIN
【3】Windows版软件下载:
https://drive.google.com/file/d/1uuDkF4j4H1AI1ot88XdqzwMdvAPhxKN8/view
https://pan.baidu.com/s/1j1r0OxpClcFiWoHWcbHXkA 提取码:5lka
【4】本文转自量子位公众号
————————————————————————————————————————————
后记
测试了 DAIN 插帧开源算法,可能是
版本 Alpha 0.2 的原因感觉还不太理想。
配置要求很高,必须N卡,且有CUDA、cudnn的深度学习环境,我用4X GTX 1080TI测试了,只识别了单卡,不支持软件多开,而且1080p分辨率会爆显存,然后我换了一部单卡 RTX 2080 TI 还是炸。最后用了 Tesla V100 的32G单卡显存才没炸。
检查了下程序源码编译发现原来是梯度都没关,肯定炸显存,这个封装做的太草率了。
速度方面
5秒的720p gif 8倍补帧 25fps 补 200fps 用 GTX 1080 TI 费时20分钟。
然后做了一个完整动画OP的测试。这里选了绝对双刃 Absolute Duo(2015)OP,江畑谅真 一人原画。很棒的作画,但之前我微博也说过这个画出来的感觉帧率不够,流畅度还欠缺,正好拿来做测试。
图可以看出算法在每帧插多了很多预判帧,涂抹感就是深度学习的卷积算法毛病。
后面做了一个真人电影 双子杀手 Gemini Man (2019) 测试,主要这部有官方版的60帧,正好拿来对比,真人补的效果还行。实拍的就没有那种涂抹感。
绝对双刃 Absolute Duo(2015)OP
https://pan.baidu.com/s/1cuhINpNhlW-jBFYR203_FQ 提取码:nt7x
双子杀手 Gemini Man (2019) 片段
https://pan.baidu.com/s/1ag9w8_l7TpBYH6SgRYUwPQ 提取码:wtjj
环境测试
Anaconda 3.5.2.0
cuda_10.0.130_411.31
cudnn 10
python 3.6.5
PyTorch 1.2.0
版本 Alpha 0.32(支持Split franes分割帧了)
1080视频 8倍补帧 25fps 补 200fps 用 GTX 1080 TI 12小时400帧
留言列表
MetabolicFreedomdog 在 11/5/2025, 1:19:27 PM 说:
Discover the real reason diets fail and how a 30-day metabolic reset can change everything. https://metabolicfreedom.top/ metabolic freedom book
LaTeoriaLetThemblump 在 11/5/2025, 12:26:25 PM 说:
?Cansado de buscar aprobacion? La teoria Let Them te ensena a priorizar tu bienestar sin culpa ni drama. https://lateorialetthem.top/ the theory of let them
MetabolicFreedomdog 在 11/5/2025, 6:52:23 AM 说:
Escape the diet rollercoaster. Metabolic Freedom offers a smarter, sustainable path to real health. https://metabolicfreedom.top/ metabolic freedom
LaTeoriaLetThemblump 在 11/5/2025, 3:22:02 AM 说:
Tu tiempo es valioso. No lo gastes en tratar de cambiar a quienes no quieren cambiar. https://lateorialetthem.top/ la teorГa let them epub
LaTeoriaLetThemblump 在 11/5/2025, 1:14:27 AM 说:
Dejalos estar es la herramienta definitiva para quienes quieren vivir con menos estres y mas enfoque. https://lateorialetthem.top/ teorГa de let them
MetabolicFreedomdog 在 11/5/2025, 12:37:34 AM 说:
Metabolic Freedom: where science meets simplicity for real, lasting transformation. https://metabolicfreedom.top/ metabolic freedom podcast
LaTeoriaLetThemblump 在 11/4/2025, 11:01:10 PM 说:
?Por que te cuesta ser feliz? Tal vez estas entregando tu poder. Descubre como recuperarlo con Let Them. https://lateorialetthem.top/ let them theory what is it
MetabolicFreedomdog 在 11/4/2025, 10:27:58 PM 说:
Metabolic Freedom delivers a step-by-step plan to break free from metabolic dysfunction for good. https://metabolicfreedom.top/ ben azadi metabolic freedom
MetabolicFreedomdog 在 11/4/2025, 8:28:01 PM 说:
Say goodbye to food obsession. Metabolic Freedom teaches you how to eat for lifelong metabolic health. https://metabolicfreedom.top/ metabolic freedom ben azadi
LaTeoriaLetThemblump 在 11/4/2025, 6:37:53 PM 说:
?Por que te cuesta ser feliz? Tal vez estas entregando tu poder. Descubre como recuperarlo con Let Them. https://lateorialetthem.top/ the let them theory mel robbins pdf free download
MetabolicFreedomdog 在 11/4/2025, 6:17:11 PM 说:
Learn how hormones, sleep, and food choices impact your metabolism and how to optimize them all. https://metabolicfreedom.top/ degrees of freedom in metabolism
LaTeoriaLetThemblump 在 11/4/2025, 4:17:15 PM 说:
La libertad emocional empieza cuando dejas de intentar controlar a los demas. Dejalos estar y vive libre. https://lateorialetthem.top/ mel robbins the let them theory pdf
MetabolicFreedomdog 在 11/4/2025, 1:46:04 PM 说:
Metabolic Freedom helps you understand your body's signals and reset your metabolism the right way. https://metabolicfreedom.top/ metabolic freedom audiobook
LaTeoriaLetThemblump 在 11/4/2025, 8:51:11 AM 说:
No necesitas la aprobacion de nadie para vivir bien. Descubre el poder transformador de Let Them. https://lateorialetthem.top/ audible let them theory
MetabolicFreedomdog 在 11/4/2025, 3:25:41 AM 说:
Say yes to stable energy, better sleep, and natural weight regulation with Metabolic Freedom. https://metabolicfreedom.top/ metabolic freedom book free download
MetabolicFreedomdog 在 11/4/2025, 1:44:09 AM 说:
Take back control of your health with a metabolism-focused plan that actually delivers results. https://metabolicfreedom.top/ metabolic freedom reviews
LaTeoriaLetThemblump 在 11/3/2025, 10:19:04 PM 说:
?Te sientes atrapado en el drama ajeno? Sal de ahi. Tu energia es demasiado valiosa para perderla. https://lateorialetthem.top/ mel robbins let them theory epub
LaTeoriaLetThemblump 在 11/3/2025, 4:13:02 PM 说:
?Te cuesta soltar el pasado o las expectativas ajenas? Let Them te ensena a dejarlo ir con calma. https://lateorialetthem.top/ let them theory book
MetabolicFreedomdog 在 11/3/2025, 2:37:21 PM 说:
Ditch calorie counting forever. Learn how to reset your metabolism and thrive with Metabolic Freedom. https://metabolicfreedom.top/ metabolic freedom podcast
LaTeoriaLetThemblump 在 11/3/2025, 2:06:03 PM 说:
Tu vida mejora cuando dejas de controlar lo que no puedes cambiar. Dejalos estar y sigue tu camino. https://lateorialetthem.top/ la teorГa let them. la clave estГЎ en soltar
ArtisanFudge 在 11/3/2025, 7:18:25 AM 说:
Создавайте с душой, и ваши вещи будут жить дольше вас https://artisanalcrafts.ru/
ArtisanFudge 在 11/2/2025, 10:25:42 AM 说:
Создавайте уют, красоту и гармонию - всё это возможно своими руками https://artisanalcrafts.ru/
ArtisanFudge 在 11/2/2025, 12:06:43 AM 说:
Творчество без границ - от простых поделок до изысканных арт-объектов. Начните с нами https://artisanalcrafts.ru/
ArtisanFudge 在 11/1/2025, 1:34:45 PM 说:
Учитесь у мастеров, вдохновляйтесь их работами и создавайте своё уникальное наследие https://artisanalcrafts.ru/
ArtisanFudge 在 11/1/2025, 3:18:58 AM 说:
Устали от масс-маркета? Научитесь делать красивые и полезные вещи самостоятельно https://artisanalcrafts.ru/
Sidneysaple 在 2/25/2025, 9:53:39 AM 说:
Many thanks! Ample write ups.
names of online casinos https://combatcasino.info/poker/ rush games online casino
Sidneysaple 在 2/24/2025, 11:39:52 AM 说:
Regards. I appreciate it.
free buffalo casino games online https://combatcasino.info/casino-apps/ cheap casino online
CasinosAlleK 在 2/21/2025, 10:50:36 PM 说:
This is nicely expressed. !
online casinos fast payout https://casinosonlinenew.com/slots-online/ online casinos ohne umsatzbedingungen
ZerFpTgYO 在 12/11/2023, 12:37:07 PM 说:
Ionized calcium levels within a cell determine the force of contraction of muscular tissues <a href=http://vpriligys.buzz>priligy dapoxetine</a> MEKK, MAPK Erk kinase; P, Phosphogroup; RAF, RAF proto oncogene serine threonine protein kinase; RAS, Rat sarcoma; TF, transcription factor