Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    CastError
Message:      Couldn't cast
text: string
metadata: string
video: string
quality: string
caption: string
to
{'video': Value('string'), 'metadata': Value('string'), 'caption': Value('string'), 'quality': Value('string')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 489, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2818, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2355, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2380, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2297, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              text: string
              metadata: string
              video: string
              quality: string
              caption: string
              to
              {'video': Value('string'), 'metadata': Value('string'), 'caption': Value('string'), 'quality': Value('string')}
              because column names don't match

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

ramanv-video-foundation

A production-grade, highly-scalable dataset engineering platform designed for collecting, processing, validating, captioning, scoring, deduplicating, and publishing generative video datasets at scale.

The repository is built to process datasets scaling up to 1M+ videos, supporting keyframe extraction, multi-VLM captioning, OCR extraction, audio/speech transcription, CLIP/video embeddings, dense optical flow motion scoring, monocular depth mapping, semantic segmentation, deduplication, quality filters, and automated uploading to the Hugging Face Hub.


πŸ“‚ Folder Layout

ramanv-video-foundation/
β”œβ”€β”€ README.md                 # Dataset Card & Guide
β”œβ”€β”€ LICENSE                   # Apache-2.0 License
β”œβ”€β”€ pyproject.toml            # Project configurations and packages
β”œβ”€β”€ requirements.txt          # Python dependency list
β”œβ”€β”€ dataset_infos.json        # HF Dataset features schema
β”œβ”€β”€ create_repo.sh            # Bash initialization script
β”œβ”€β”€ create_repo.ps1           # PowerShell initialization script
β”‚
β”œβ”€β”€ configs/                  # Pipeline configurations (YAML)
β”‚   └── default.yaml
β”‚
β”œβ”€β”€ videos/                   # Video folders grouped into 120 categories
β”‚   β”œβ”€β”€ marketing_ads/
β”‚   β”œβ”€β”€ product_ads/
β”‚   β”œβ”€β”€ indian_weddings/
β”‚   └── ... (117 other folders)
β”‚
β”œβ”€β”€ keyframes/                # Extracted keyframes (JPEG)
β”œβ”€β”€ previews/                 # Low-resolution preview GIFs
β”œβ”€β”€ thumbnails/               # Primary video cover images
β”œβ”€β”€ captions/                 # Generated caption JSONs
β”œβ”€β”€ metadata/                 # Schema-compliant JSON files (62 fields)
β”œβ”€β”€ manifests/                # Dataset manifest files (JSON)
β”œβ”€β”€ quality/                  # Quality reports
β”œβ”€β”€ embeddings/               # Precomputed CLIP/Video embedding matrices (.npy)
β”œβ”€β”€ optical_flow/             # Optical flow analysis files
β”œβ”€β”€ depth/                    # Monocular depth maps
β”œβ”€β”€ segmentation/             # Semantic segmentation masks
β”œβ”€β”€ ocr/                      # OCR detections with timestamps
β”œβ”€β”€ audio/                    # Extracted audio tracks (.wav)
β”œβ”€β”€ transcripts/              # Transcripts with word timestamps
β”œβ”€β”€ splits/                   # Train/Val/Test split records
β”œβ”€β”€ logs/                     # Rotation log output files
└── src/                      # Core utility codebase

πŸ“Š Video Categories

The dataset organizes assets into 120 distinct category folders under videos/, including:

  • Commercial & Ads: marketing_ads, product_ads, cosmetics, real_estate, fashion, food, restaurants, electronics, unboxing, reviews.
  • Social Media: social_media, instagram_reels, youtube_shorts, vlogs, interviews, gaming, talk_shows.
  • Culture & People: indian_weddings, festivals, temples, villages, city_life, street_markets, office, workspace, children, elderly, pets, dancing, cooking, diy.
  • Visual Styles: cinematic, drone, timelapse, slow_motion, hyperlapse, stop_motion, animation, 3d, cgi, documentary, news, underwater, aerial, macro, first_person.
  • Physical & Motion Elements: nature, water, fire, snow, space, sunset, night, sports, fitness, running, yoga.
  • Industrial & Professional: science, technology, robots, medical, construction, agriculture, tutorials, e_learning, conferences, workshops.

πŸ› οΈ Getting Started

  1. Clone & Install Dependencies:

    pip install -r requirements.txt
    
  2. Initialize Folder Structure: On Linux:

    bash create_repo.sh
    

    On Windows (PowerShell):

    powershell -ExecutionPolicy Bypass -File .\create_repo.ps1
    
  3. Add Raw Video Assets: Place your raw video files (.mp4, .mkv, .avi, etc.) inside their respective category subdirectories under videos/.


πŸš€ Sequential Execution Pipeline

To compile a fully processed and validated dataset, execute the processing scripts in the following sequence:

graph TD
    A[Raw Videos] --> B[Keyframe Extraction]
    A --> C[Audio Demuxing]
    B --> D[Visual Captioning]
    B --> E[Video OCR]
    B --> F[CLIP Embeddings]
    B --> G[Depth Estimation]
    B --> H[Semantic Segmentation]
    C --> I[Speech Transcription]
    A --> J[Video Embeddings]
    A --> K[Motion Analysis]
    D & E & F & G & H & I & J & K --> L[Quality Filtering]
    L --> M[Deduplication]
    M --> N[Create Splits]
    N --> O[Auditing & Validation]
    O --> P[HuggingFace Upload]

1. Keyframe Extraction

Extract representative keyframes, previews, and cover thumbnails:

python scripts/extract_keyframes.py --method adaptive --num-keyframes 5

2. Audio Extraction

Extract audio tracks (WAV formats are generated to feed transcription models):

python scripts/extract_audio.py --format wav

3. Speech Transcription

Run Whisper transcription with word-level timestamps and language identification:

python scripts/transcribe_audio.py --model base --gpu-id 0

4. Video Captioning

Generate short summaries and dense captions using Vision LLMs:

python scripts/generate_video_captions.py --model Qwen/Qwen2.5-VL-7B-Instruct --gpu-id 0

5. Video OCR

Extract onscreen text overlays and associate temporal timestamps:

python scripts/video_ocr.py --languages en

6. CLIP Embeddings

Extract sequence frame embeddings using OpenCLIP or SigLIP:

python scripts/compute_clip_embeddings.py --model-family openclip --model-name ViT-H-14

7. Video Embeddings

Extract unified spatial-temporal video representations:

python scripts/compute_video_embeddings.py --model microsoft/xclip-base-patch16

8. Motion Analysis

Compute Farneback dense optical flow to categorize camera and object movement:

python scripts/motion_analysis.py --sample-fps 5.0

9. Monocular Depth Estimation

Generate keyframe depth maps for visual structure mapping:

python scripts/depth_estimation.py --model LiheYoung/depth-anything-base-hf

10. Semantic Segmentation

Segment keyframes to isolate subjects, roads, sky, and backgrounds:

python scripts/segment_video.py --model nvidia/segformer-b0-finetuned-ade-512-512

11. Quality Filtering

Score visual fidelity, filter blurry/compressed clips, detect black screen errors, and screen watermarks:

python scripts/quality_filter.py --min-width 1280 --min-height 720

12. Deduplication

Cluster and remove exact or near-duplicate assets:

python scripts/deduplicate.py --phash-threshold 8 --cosine-threshold 0.96

13. Create Splits

Generate balanced training, validation, and testing partitions:

python scripts/create_splits.py --train-ratio 0.8 --val-ratio 0.1 --test-ratio 0.1

14. Dataset Validation

Audit metadata files and manifest schemas to ensure integrity:

python scripts/validate_dataset.py

15. Hugging Face Upload

Publish the compiled dataset folder to HuggingFace Hub:

python scripts/upload_hf.py --repo-id username/ramanv-video-foundation

πŸš€ Model Training Guide

1. Fine-tuning Video Diffusion Transformers (DiTs)

Modern video generative architectures (e.g., Sora, LTX-Video, CogVideoX) process video as a sequence of spatial-temporal patches.

  • Dense Captioning: Always train using the long_caption metadata field. Large text encoders like T5-XXL parse spatial relationships, camera pan movements, and action sequences detailed in the caption.
  • Temporal Aspect Bucketing: Group video training items by aspect ratio class and FPS bins to avoid spatial distortion and temporal jitter during batch training.
  • Motion Filtering: Use the computed motion_score and camera_motion tags. To train high-action video models, filter out clips with motion_score < 0.2 (static scenes). For camera motion editing (e.g. pan left/right condition), filter using the camera_motion category labels.

2. Audio-Visual Video Generation

  • Use the word-level transcripts in transcripts/ combined with the extracted audio track audio/ to train audio-visual synchronization networks, talking-head generators, or sound-aligned video generation.

3. Depth-conditioned ControlNet

  • Train depth-conditioned spatial controllers by utilizing the computed depth maps under the depth/ folder as auxiliary controls, enabling structure-consistent video generation.

πŸ“„ License

This repository is licensed under the Apache License 2.0. See LICENSE for more details.

Downloads last month
63