Skip to content

VBVR-DataFactory/G-189_draw_midpoint_perpendicular_line_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

G-189: Draw Midpoint Perpendicular Line Data Generator

Generates synthetic tasks where two parallel lines are shown with marked points. The goal is to draw a red perpendicular line through the midpoint between the marked points, extending from one parallel line to the other.

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-189
Task Draw Midpoint Perpendicular Line
Category Perception
Resolution 1024×1024 px
FPS 10 fps
Duration ~5 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-189_draw_midpoint_perpendicular_line_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

Draw a red perpendicular line through the middle point between two parallel lines. The line should extend from the upper parallel line to the lower parallel line.

Visual

Initial Frame
Two parallel lines with marked points
Animation
Red perpendicular line grows from midpoint
Final Frame
Complete perpendicular line through midpoint

📖 Task Description

Objective

Construct a perpendicular line through the midpoint (located at mid_y, the middle y-coordinate between the two parallel lines), extending the line to connect both parallel lines.

Task Setup

  • Parallel Lines: Two horizontal lines (black)
  • Marked Points: Multiple colored points (4-14 points) placed between the parallel lines
    • Points use 30 distinct colors from a predefined palette
    • All points except the midpoint are positioned far from the midpoint's y-coordinate (mid_y)
    • The midpoint is located at mid_y (the middle of the two parallel lines), making it visually obvious
  • Midpoint: The point at mid_y (middle y-coordinate between the two parallel lines)
    • X-coordinate is randomly positioned (not fixed)
    • Y-coordinate is exactly at mid_y = (line1_y + line2_y) / 2
    • Visually obvious because all other points are far from this y-coordinate
  • Perpendicular Line: Red line drawn perpendicular to the parallel lines
  • Line Extension: Perpendicular line extends from upper to lower parallel line
  • Animation Style: Line grows outward from the midpoint in both directions

Key Features

  • Geometric precision: Line passes exactly through the calculated midpoint
  • Perpendicularity: Line is exactly 90° to the parallel lines
  • Visual clarity: Red color distinguishes the constructed line from existing elements
  • Smooth animation: Line grows progressively from center outward (5 seconds at 10 fps)
  • Complete extension: Line fully spans from one parallel line to the other
  • Color diversity: 30 distinct colors for points, increasing visual variety
  • Midpoint identification: Midpoint is obvious by position (mid_y) since all other points are far from this y-coordinate
  • Multiple prompt variations: 5 different prompt phrasings for task description variety

📦 Data Format

data/questions/draw_midpoint_perpendicular_line_task/draw_midpoint_perpendicular_line_00000000/
├── first_frame.png      # Initial state (parallel lines with points)
├── final_frame.png      # Goal state (with perpendicular line)
├── prompt.txt           # Task instructions
├── ground_truth.mp4     # Solution video (10 fps)
└── question_metadata.json # Task metadata

File specifications: Images are 1024×1024 PNG. Videos are MP4 at 10 fps, approximately 5 seconds long showing the line construction process.


🏷️ Tags

geometry perpendicular-lines midpoint geometric-construction spatial-reasoning line-drawing


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages