全网首发:智谱「Sora」此刻开源,单卡可跑可调,附训练细节
长话短说
*注1:推理均 21.6G,峰 36G,微调稳定 46.2G,在 A6000 范围内
*注2:刚更新了推理优化,现在峰 18G,可以 4090 单卡跑了
本次开源:CogVideoX-2B
HF: huggingface.co/THUDM/CogVideoX-2b
Git: github.com/THUDM/CogVideo
短话长说
在 智谱 DemoDay,以脱口秀演员身份,顶着「大聪明」名头....出道了
PUA 智谱小伙伴,大半夜的,给这次的开源加 Feature
蹭了好几天的盒饭、零食、雪糕、快乐水
一些效果
提示词:A detailed wooden toy ship with intricately carved masts and sails is seen gliding smoothly over a plush, blue carpet that mimics the waves of the sea. The ship's hull is painted a rich brown, with tiny windows. The carpet, soft and textured, provides a perfect backdrop, resembling an oceanic expanse. Surrounding the ship are various other toys and children's items, hinting at a playful environment. The scene captures the innocence and imagination of childhood, with the toy ship's journey symbolizing endless adventures in a whimsical, indoor setting.
提示词:The camera follows behind a white vintage SUV with a black roof rack as it speeds up a steep dirt road surrounded by pine trees on a steep mountain slope, dust kicks up from it’s tires, the sunlight shines on the SUV as it speeds along the dirt road, casting a warm glow over the scene. The dirt road curves gently into the distance, with no other cars or vehicles in sight. The trees on either side of the road are redwoods, with patches of greenery scattered throughout. The car is seen from the rear following the curve with ease, making it seem as if it is on a rugged drive through the rugged terrain. The dirt road itself is surrounded by steep hills and mountains, with a clear blue sky above with wispy clouds.
提示词:In the haunting backdrop of a war-torn city, where ruins and crumbled walls tell a story of devastation, a poignant close-up frames a young girl. Her face is smudged with ash, a silent testament to the chaos around her. Her eyes glistening with a mix of sorrow and resilience, capturing the raw emotion of a world that has lost its innocence to the ravages of conflict.
提示词:A single butterfly with wings that resemble stained glass flutters through a field of flowers. The shot captures the light as it passes through the delicate wings, creating a vibrant, colorful display. HD.
提示词:A snowy forest landscape with a dirt road running through it. The road is flanked by trees covered in snow, and the ground is also covered in snow. The sun is shining, creating a bright and serene atmosphere. The road appears to be empty, and there are no people or animals visible in the video. The style of the video is a natural landscape shot, with a focus on the beauty of the snowy forest and the peacefulness of the road.
提示词:Extreme close-up of chicken and green pepper kebabs grilling on a barbeque with flames. Shallow focus and light smoke. vivid colours
技术概览
架构:3D VAE + 专家 Transformer
限制:提示词上限为 226 tokens,长度 6 秒,帧率为 8,分辨率 720*480
显卡:FP-16 精度下:4090 可推理(21.6G / 24G),A6000 可微调(46.2G / 48G)
数据:训练数据来自互联网,共数万个小时,其中有来自B站的技术支持
标注:所用到的视频文本描述,由 AI 生成
训练:分为三个阶段:低分辨率训练、高分辨率训练和高质量视频微调
反馈:评估阶段,由 AI 和人类合作进行
关于架构
编码器 (Encoder):把复杂的视频转换成一个简化的代码。
解码器 (Decoder):根据这个代码重建出原来的视频。
潜在空间正则化器 (Latent Space Regularizer):确保编码器和解码器之间的信息传递更准确。
转换代码:首先,模型使用T5模型将文字和视频分别转换成代码。
结合代码:然后,将文字和视频的代码结合在一起。
多层次处理:专家Transformer模型有多个部分,每个部分负责不同的任务,如处理视频的空间和时间信息、控制信息流动等。通过多层次的处理,模型逐渐提取出更有用的信息。
生成视频:最后,将处理后的代码反向转换回原始形式,并生成最终的视频。
关于数据
剪辑干扰:视频通常经过剪辑处理,包含如转场、拼接、特效等内容,不能准确映射真实世界
拍摄扰动:拍摄环境不可能完美,存在抖动、设备不佳等问题
转换代码:首先,模型使用T5模型将文字和视频分别转换成代码。
结合代码:然后,将文字和视频的代码结合在一起。
编辑痕迹:明显经过人工编辑、特效处理的视频。
缺乏运动连贯性:图像转换生硬、缺乏连贯性的视频,常见于人工拼接或编辑。
低质量:拍摄模糊、抖动严重的视频。
讲课类型:运动量少、以人物说话为主的视频,如教育内容、讲座等。
以文本为主:包含大量文字或主要聚焦于文字内容的视频。
噪声截图:来自手机或电脑屏幕的录屏视频。
先利用 Panda70M 模型生成简短描述。
再使用 CogView3 生成密集图像描述。
然后用 GPT-4 总结所有图像描述,生成最终视频描述。
进而用这些描述,微调了一个 Llama 2 模型,实现了大规模视频描述数据的生成。
为进一步提升效率,使用 CogVLM2-Video 和 Llama 3,基于上述生成的描述,微调了一个端到端视频理解模型 CogVLM2-Caption。
关于训练
由于图像和视频输入类型之间存在显著差距,图像有 1 帧而视频有几十帧,使得模型会根据输入类型,分裂成两种生成模式,泛化效果不好
对于固定时长的训练,短视频会被丢弃,长视频会被截断,导致了视频的帧数不能被充分利用。
关于评估
以上,就是来自「赛博禅心」的诚意报道