Skip to content

VBVR-DataFactory/G-168_identify_nearest_to_square_rectangle_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

G-168: Identify Nearest To Square Rectangle Data Generator

Generates synthetic tasks where multiple rectangles are displayed, and the goal is to identify and circle the rectangle whose aspect ratio is closest to a perfect square (1:1 ratio).

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-168
Task Identify Nearest To Square Rectangle
Category Perception
Resolution 1024×1024 px
FPS 16 fps
Duration ~3.75 seconds
Output PNG images + MP4 video

🚀 Usage

Installation

# Clone the repository
git clone https://github.com/Jiaqi-Gong/Gong_VBVR_Data.git
cd Gong_VBVR_Data/G-168_identify_nearest_to_square_rectangle_data-generator

# Install dependencies
pip install -r requirements.txt

Generate Data

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

# Generate with specific seed
python examples/generate.py --num-samples 100 --seed 42

# Generate without videos
python examples/generate.py --num-samples 100 --no-videos

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

Command-Line Options

Argument Type Description Default
--num-samples int Number of samples to generate 100
--seed int Random seed for reproducibility Random
--output str Output directory data/questions
--no-videos flag Skip video generation False

📖 Task Example

Prompt

The scene shows several axis-aligned rectangles with different widths and heights. First compare how close each rectangle is to a perfect square (width-to-height ratio closest to 1:1), then draw one red circle around the single rectangle that is closest to a square. Do not circle any other rectangles. Show the complete solution step by step.

Visual

Initial Frame
Multiple rectangles with varied dimensions
Animation
Red circle drawn around nearest-to-square rectangle
Final Frame
Target rectangle circled in red

📖 Task Description

Objective

Compare the aspect ratios of multiple rectangles to identify which one is closest to a perfect square (1:1 width-to-height ratio) and mark it with a red circle.

Task Setup

  • Rectangle Count: 3-6 rectangles per image
  • Rectangle Dimensions: Side lengths between 60-180 pixels
  • Target Rectangle: Aspect ratio 0.97-1.03 (very close to square)
  • Distractor Rectangles: Aspect ratios either <0.80 (thin) or >1.25 (wide)
  • Uniqueness Guarantee: Target rectangle has at least 0.10 margin over second-best candidate
  • Circle Properties: 16-pixel red stroke, 62-pixel padding around target
  • Spacing: Minimum 31-pixel gap between rectangles

Key Features

  • Clear distinction: Target is definitively closest to square with guaranteed margin
  • Diverse colors: 12-color palette for rectangle fills (red reserved for marking)
  • Non-overlapping layout: Rectangles maintain minimum spacing
  • Unambiguous answer: Only one rectangle is closest to square ratio
  • Step-by-step animation: Shows reasoning process and circle placement
  • Aspect ratio reasoning: Tests understanding of proportions and ratios

📦 Data Format

data/questions/identify_nearest_to_square_rectangle_task/identify_nearest_to_square_rectangle_00000000/
├── first_frame.png      # Initial state (rectangles without marking)
├── final_frame.png      # Goal state (nearest-to-square circled)
├── prompt.txt           # Task instructions
├── ground_truth.mp4     # Solution video (16 fps)
└── question_metadata.json # Task metadata

File specifications: Images are 1024×1024 PNG. Videos are MP4 at 16 fps, approximately 3.75 seconds long.


🏷️ Tags

geometry aspect-ratio rectangle-analysis proportions spatial-reasoning comparison


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages