Video DataLoader Pipeline (Decord + tf.data)

Build configurable video data pipelines with Decord PyTorch and tf.data TPU paths.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/sovr610/refffiy --skill video-dataloader-pipeline-decord-tf-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Video DataLoader Pipeline (Decord + tf.data)
Source: https://github.com/sovr610/refffiy/tree/main/brain-ai-dev/skills/video-dataloader-pipeline
Command: npx skills add https://github.com/sovr610/refffiy --skill video-dataloader-pipeline-decord-tf-data

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires decord, torch, torchvision, numpy, Pillow, imageio, opencv-python, tensorflow, psutil, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill provides a complete blueprint for building production-grade video data pipelines, unifying Decord-based PyTorch loading with tf.data-based TPU pipelines to streamline multi-backend training workflows.

Core Features & Use Cases

  • Multi-backend support: PyTorch with Decord VideoReader and tf.data with sharded TFRecords, enabling GPU and TPU training paths.
  • Deterministic sampling and augmentation: Robust temporal frame sampling with fixed stride and random starts, plus GPU-accelerated augmentations and deterministic eval transforms.
  • Lightning DataModule integration: Clean interfaces for train/val/test datasets and dataloaders with correct distributed sampling behavior.
  • Templates and references: Ready-to-use templates for VideoDataset, TFRecordConverter, tf.data pipelines, and reference materials to accelerate integration.

Quick Start

Create a video dataloader pipeline using Decord and tf.data, then wire it into a Lightning DataModule.

Frequently Asked Questions about Video DataLoader Pipeline (Decord + tf.data)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a video dataloader pipeline that supports both PyTorch and TPU training?

Build a video dataloader pipeline using Decord for PyTorch and sharded TFRecords for tf.data to enable multi-backend GPU and TPU training workflows. The pipeline unifies both paths with consistent video metadata caching and robust frame sampling.

What's the best way to handle temporal frame sampling in a video dataloader?

Temporal frame sampling in a video dataloader is handled using robust sampling with fixed stride and random starts. This approach provides deterministic eval transforms and supports GPU-accelerated augmentations during training.

Can I use this video pipeline with PyTorch Lightning DataModules?

Yes, the video pipeline integrates directly with PyTorch Lightning DataModules. It provides clean interfaces for train, val, and test datasets with correct distributed sampling behavior for multi-GPU training.

Does the tf.data video pipeline require converting videos to TFRecords first?

Yes, the tf.data video pipeline requires converting videos to sharded TFRecords. The solution includes ready-to-use TFRecord conversion templates and configurable video dataset definitions to streamline this process.

How do I convert a video dataset to TFRecords for TPU training?

Convert a video dataset to TFRecords using the provided TFRecordConverter templates. These templates support sharded output creation and include validation hooks with documented defaults to ensure data integrity for TPU training.

Why does my video dataloader pipeline need metadata caching?

Video dataloader pipelines need metadata caching to avoid repeatedly scanning large video files for frame counts and timestamps. Caching this metadata accelerates dataset initialization and ensures consistent frame sampling across training epochs.