DAVIS-Edit
收藏资源简介:
StableV2V数据集是一个用于视频编辑的测试基准,名为DAVIS-Edit。它包含视频帧、标注掩码和参考图像,以及两个JSON文件,分别用于图像和文本编辑的标注描述。数据集的结构与DAVIS数据集相同,旨在稳定视频编辑中的形状一致性。
The StableV2V dataset, named DAVIS-Edit, is a test benchmark for video editing. It contains video frames, annotation masks, reference images, and two JSON files that provide annotation descriptions for image editing and text editing respectively. The dataset follows the same structure as the DAVIS dataset, with the goal of ensuring stable shape consistency in video editing.
DAVIS-Edit 数据集概述
数据集简介
DAVIS-Edit 数据集是用于视频编辑任务的测试基准,源自论文 "StableV2V: Stablizing Shape Consistency in Video-to-Video Editing"。该数据集遵循与 DAVIS 相同的数据结构。
数据结构
数据集的目录结构如下:
DAVIS-Edit ├── Annotations <----- DAVIS 的官方标注掩码 ├── bear ├── blackswan ├── ... └── train ├── JPEGImages <----- DAVIS 的官方视频帧 ├── bear ├── blackswan ├── ... └── train ├── ReferenceImages <----- DAVIS-Edit 的基于图像编辑的参考图像 ├── bear.png ├── blackswan.png ├── ... └── train.png ├── .gitattributes ├── README.md ├── edited_video_caption_dict_image.json <----- 基于图像编辑的文本描述标注 └── edited_video_caption_dict_text.json <----- 基于文本编辑的文本描述标注
详细说明
edited_video_caption_dict_image.json和edited_video_caption_dict_text.json是 Python 字典格式的标注文件,键为JPEGImages中的视频文件夹名称。- 参考图像的标注包含两个子文件夹:
similar和changing,分别对应DAVIS-Edit-S和DAVIS-Edit-C的标注。
使用方法
建议通过标注文件索引 DAVIS-Edit 中的不同元素。以下是一个示例脚本:
python
import os
import json
from tqdm import tqdm
from PIL import Image
TODO: 根据本地路径修改配置
frame_root = JPEGImages mask_root = Annotations reference_image_root = ReferenceImages/similar # 或 ReferenceImages/changing annotation_file_path = edited_video_caption_dict_text.json
加载标注文件
with open(annotation_file_path, r) as f: annotations = json.load(f)
遍历 DAVIS-Edit 中的所有数据样本
for video_name in tqdm(annotations.keys()):
加载文本提示
original_prompt = annotations[video_name][original] similar_prompt = annotations[video_name][similar] changing_prompt = annotations[video_name][changing]
加载参考图像
reference_image = Image.open(os.path.join(reference_image_root, video_name + .png))
加载视频帧
video_frames = [] for path in sorted(os.listdir(os.path.join(frame_root, video_name))): if path != Thumbs.db and path != .DS_store: video_frames.append(Image.open(os.path.join(frame_root, path)))
加载掩码
masks = [] for path in sorted(os.listdir(os.path.join(mask_root, video_name))): if path != Thumbs.db and path != .DS_store: masks.append(Image.open(os.path.join(frame_root, path)))
(在以下行中添加您期望的进一步操作)




