Paper: Liu S, Zhang Y, Li W, et al. Video-p2p: Video editing with cross-attention control[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2024: 8599-8608.
Introduction: https://video-p2p.github.io/
Code: https://github.com/dvlab-research/Video-P2P

Video-P2P 是第一个实现真实世界视频编辑的框架,将图像生成扩散模型适配于视频编辑任务。Video-P2P 先微调一个文本到集合的模型来进行反演,然后优化一个共享的无条件嵌入,以小内存代价实现准确的视频反转。在注意力控制方面,Video-P2P 引入了一种解耦引导策略,为源提示和目标提示使用不同的引导策略。针对源提示优化的无条件嵌入提高了重建能力,而为目标提示初始化的无条件嵌入增强了可编辑性。将这两个分支的注意力图结合起来,使得编辑更加精细。

复现
实验过程:
-
克隆仓库后,创建虚拟环境
vp2p并按照 README 安装依赖; -
初始化模型时遇到
ImportError: cannot import name 'cached_download' from 'huggingface_hub'报错:

将
~/anaconda3/envs/vp2p/lib/python3.9/site-packages/diffusers/dynamic_modules_utils.py中的from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info注释掉即可 [1](#1); -
然后又遇到
NotImplementedError: Using RTX 4000 series doesn't support faster communication broadband via P2P or IB.报错:

运行时加上
NCCL_P2P_DISABLE和NCCL_IB_DISABLE参数即可:NCCL_P2P_DISABLE="1" NCCL_IB_DISABLE="1" python run_tuning.py --config="configs/rabbit-jump-tune.yaml"; -
又遇到
RuntimeError: Numpy is not available报错:
将 numpy降级成1.26.4即可 [2](#2):pip install numpy==1.26.4;
实验结果:
原视频:
编辑视频: