Skip to content

VBVR-DataFactory/G-195_select_nearest_2_1_rectangle_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

G-195: Select Nearest 2:1 Rectangle Data Generator

Generates synthetic tasks where multiple rectangles with different aspect ratios are displayed. The goal is to identify and circle the rectangle whose aspect ratio is closest to 2:1 (where the longer side is about twice the shorter side).

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-195
Task Select Nearest 2:1 Rectangle
Category Perception
Resolution 1024×1024 px
FPS 16 fps
Duration ~5.6 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-195_select_nearest_2_1_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 rectangles with different widths and heights. A rectangle matches a 2:1 aspect ratio if its longer side is about twice its shorter side, regardless of orientation. First compare all rectangles and determine which single rectangle is closest to a 2:1 aspect ratio, then draw one red circle around that rectangle. Do not circle any other rectangles. Show the complete solution step by step.

Visual

Image Image Image
Initial Frame
Rectangles with varied aspect ratios
Animation
Red circle drawn around 2:1 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 2:1 (longer side approximately twice the shorter side) and mark it with a red circle.

Task Setup

  • Rectangle Count: 3-5 rectangles per image
  • Rectangle Dimensions: Side lengths between 80-220 pixels
  • Target Rectangle: Aspect ratio 1.95-2.05 (very close to 2:1)
  • Distractor Rectangles:
    • Low distractors: aspect ratio ≤1.40 (further from 2:1)
    • High distractors: aspect ratio ≥2.70 (further from 2:1)
    • All distractors at least 0.40 away from 2.0
  • Uniqueness Guarantee: Target rectangle has at least 0.25 margin over second-best candidate
  • Circle Properties: 8-pixel red stroke, 18-pixel padding around target
  • Spacing: Minimum 14-pixel gap between rectangles

Key Features

  • Orientation-independent: 2:1 ratio recognized in both horizontal and vertical orientations
  • Clear distinction: Target definitively closest to 2:1 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 2:1 ratio
  • Step-by-step animation: Shows reasoning process and circle placement (10 hold + 60 transition + 20 hold frames)

📦 Data Format

data/questions/select_nearest_2:1_rectangle_task/select_nearest_2:1_rectangle_00000000/
├── first_frame.png      # Initial state (rectangles without marking)
├── final_frame.png      # Goal state (nearest-to-2:1 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 5.6 seconds long.


🏷️ Tags

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


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages