Skip to content

VBVR-DataFactory/O-8_shape_rotation_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

O-8: Shape Rotation Data Generator

Generates synthetic tasks showing a visual analogy A:B :: C:? with shape rotation transformations. The goal is to infer the rotation from A to B and apply the same rotation to C.

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 O-8
Task Shape Rotation
Category Abstraction
Resolution 1024×1024 px
FPS 16 fps
Duration ~4.5 seconds
Output PNG images + MP4 video

🚀 Usage

Installation

# Clone the repository
git clone https://github.com/VBVR-DataFactory/O-8_shape_rotation_data-generator.git
cd O-8_shape_rotation_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 image shows a visual analogy A:B :: C:? using simple shapes. A and C are the original shapes, B shows shape A after a rotation, and ? is the unknown result. Each shape has a small black marker dot to indicate its orientation. Your task is to infer the single rotation that maps A (pentagon) to B, then apply the same rotation to C (chevron) around its geometric center. The answer at ? must be shape C rotated by this angle, with size and position unchanged, so that the rotational relationship between A and B is mirrored between C and ?.

Visual

Initial Frame
Analogy A:B :: C:? with rotation rule
Animation
Shape C rotates by same angle as A→B
Final Frame
Rotation rule applied to C

📖 Task Description

Objective

Infer the rotation transformation from A to B in the analogy, then apply the same rotation to shape C to determine the answer.

Task Setup

  • Analogy Format: A:B :: C:? with four positions
  • Top Row (Rule): Shows shape A and its rotated version B
  • Bottom Row (Query): Shows shape C and unknown answer ?
  • Rotation Inference: Determine rotation angle from A to B - this generator modifies the rotation parameter of shapes while keeping all other properties (shape type, color, size, position) unchanged
  • Rule Application: Apply same rotation to C around its geometric center
  • Shape Preservation: C's size and position remain unchanged, only orientation changes

Key Features

  • Analogical reasoning: Understanding A:B :: C:? relationship pattern
  • Rotation inference: Extracting rotation angle from example transformation
  • Rule application: Applying inferred rotation to new shape
  • Geometric center: Rotating around shape's center point
  • Angle preservation: Maintaining exact rotation angle across different shapes
  • Orientation markers: Each shape has a small black dot to indicate its orientation, making rotations visible even for symmetric shapes
  • Abstract reasoning: Generalizing rotation transformation across different geometries
  • Large-scale diversity: 20 distinct shapes, 46 rotation angles, and 400 colors for extensive variety (7M+ unique combinations)

📦 Data Format

data/questions/shape_rotation_task/shape_rotation_00000000/
├── first_frame.png      # Initial state (analogy with query)
├── final_frame.png      # Goal state (query shape rotated)
├── 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 4.5 seconds long.


🏷️ Tags

analogical-reasoning rotation-transformation visual-analogy angle-inference geometric-transformation abstract-reasoning pattern-matching


About

Shape rotation visual analogy data generator (A:B :: C:?)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages