This is the code that was used to generate this video:
from decord import VideoReader, cpu
from huggingface_hub import hf_hub_download
import numpy as np
def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
converted_len = int(clip_len * frame_sample_rate)
end_idx = np.random.randint(converted_len, seg_len)
start_idx = end_idx - converted_len
indices = np.linspace(start_idx, end_idx, num=clip_len)
indices = np.clip(indices, start_idx… See the full description on the dataset page:
https://huggingface.co/datasets/hf-internal-testing/spaghetti-video-8-frames.