Skip to content

VBVR-DataFactory/G-18_grid_shortest_path_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

G-18: Grid Shortest Path Data Generator

Generates synthetic datasets for training and evaluating vision models on shortest path finding tasks. Each sample contains a simple grid with start and end points where an agent must find and traverse the shortest path.

Each sample pairs a task (first frame + prompt describing what needs to happen) with its ground truth solution (final frame showing the result + video demonstrating how to achieve it). This structure enables both model evaluation and training.


📌 Basic Information

Property Value
Task ID G-18
Task Grid Shortest Path
Category Spatiality
Resolution 1024×1024 px
FPS 16 fps
Duration ~3 seconds
Output PNG images + MP4 video

🚀 Usage

Installation

# 1. Clone the repository
git clone https://github.com/VBVR-DataFactory/G-18_grid_shortest_path_data-generator.git
cd G-18_grid_shortest_path_data-generator

# 2. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .

Generate Data

# Generate 50 samples
python examples/generate.py --num-samples 50

# Custom output directory
python examples/generate.py --num-samples 100 --output data/my_dataset

# Reproducible generation with seed
python examples/generate.py --num-samples 50 --seed 42

# Without videos (faster)
python examples/generate.py --num-samples 50 --no-videos

Command-Line Options

Argument Description
--num-samples Number of tasks to generate (required)
--output Output directory (default: data/questions)
--seed Random seed for reproducibility
--no-videos Skip video generation (images only)

📖 Task Example

Prompt

The scene shows a 10x10 grid with a red start square (containing a pink circular agent) and a blue end square. Starting from the red start square, the agent can move to adjacent cells (up, down, left, right). The goal is to move the agent to the blue end square along the shortest path.

Visual

Initial Frame
Agent at green start, purple end visible
Animation
Agent moves along shortest path
Final Frame
Agent reached purple end point

📖 Task Description

Objective

Navigate a 10×10 grid from start point to end point by following the shortest possible path.

Task Setup

  • Grid: 10×10 grid of cells with black borders
  • Start point: Colored filled cell with circular agent (e.g., green)
  • End point: Different colored filled cell (e.g., purple)
  • Agent: Circular character (color varies per sample)
  • Movement: Can move up, down, left, right to adjacent cells
  • Background: White grid with visible cell borders
  • Goal: Reach end point using minimum number of moves

Key Features

  • Pure shortest path finding without obstacles
  • Random start/end positions ensuring variety
  • Distinct color coding for start and end points (8 color options)
  • BFS algorithm guarantees optimal path
  • Grid-based movement (no diagonal)
  • Smooth animation with interpolated frames

📦 Data Format

data/questions/grid_shortest_path_task/grid_shortest_path_00000000/
├── first_frame.png      # Initial grid with start and end points
├── final_frame.png      # Agent at end point
├── prompt.txt           # Shortest path instruction
├── ground_truth.mp4     # Animation of optimal path
└── question_metadata.json # Task metadata

File specifications:

  • Images: 1024×1024 PNG format
  • Video: MP4 format, 16 fps
  • Duration: ~3 seconds

🏷️ Tags

spatiality path-planning shortest-path grid-navigation spatial-reasoning graph-algorithms


About

This is the data generator for grid: shortest path task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages