metadata
dataset_info:
features:
- name: model_name
dtype: string
- name: id_prompt
dtype: string
- name: frame_prompt
dtype: string
- name: Image
dtype: image
- name: sub_images
list:
- name: bytes
dtype: binary
- name: videos
list:
- name: motion_bucket_id
dtype: int64
- name: video_bytes
dtype: binary
- name: sub_image
dtype: image
- name: motion_bucket_id
dtype: int64
- name: video
dtype: binary
splits:
- name: train
num_bytes: 751715811
num_examples: 30
download_size: 81637911
dataset_size: 751715811
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
from datasets import load_dataset
from IPython import display
ds = load_dataset("svjack/OnePromptOneStory-Examples-Vid-head2-Exp")["train"]
def bytes_to_video(video_bytes, output_path="output.mp4"):
"""
将二进制数据转换为视频文件并保存到指定路径。
参数:
video_bytes (bytes): 视频的二进制数据。
output_path (str): 视频文件的保存路径。
返回:
str: 视频文件的路径。
"""
with open(output_path, "wb") as video_file:
video_file.write(video_bytes)
return output_path
bytes_to_video(ds[3]["video"], "vid0.mp4")
display.Video("vid0.mp4", height = 512, width = 512)
bytes_to_video(ds[-3]["video"], "vid1.mp4")
display.Video("vid1.mp4", width = 512, height = 512)