Skip to content

API Reference parrot_pipelines.planogram.grid.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_pipelines.planogram.grid.models

View source

Detection grid data models.

Provides Pydantic models for the adaptive grid detection system:

  • GridType: supported decomposition strategies
  • DetectionGridConfig: configuration for grid decomposition
  • GridCell: a single cell in the detection grid

Class DetectionGridConfig

Configuration for detection grid decomposition.

Added as an optional field to PlanogramConfig. When None or grid_type='no_grid', pipeline uses current single-image behavior.

Fields:

Field Type Default Description
grid_type GridType GridType.NO_GRID Grid decomposition strategy
overlap_margin float 0.05 Overlap between adjacent cells as ratio of cell dimension
max_image_size int 1024 Max pixel dimension for each cell image sent to LLM
rows Optional[int] None Number of rows (matrix grid)
cols Optional[int] None Number of columns (matrix grid)
flat_divisions Optional[int] None NxN divisions for flat grid (e.g., 2 = 2x2, 3 = 3x3)
zones Optional[List[Dict[str, Any]]] None Named zone definitions [{name, y_start_ratio, y_end_ratio, x_start_ratio, x_end_ratio}]

Class GridCell

A single cell in the detection grid.

Each cell represents an independent region of the ROI that will be sent to the LLM as a separate detection call.

Fields:

Field Type Default Description
cell_id str Unique identifier (e.g., 'shelf_top', 'matrix_1_2')
bbox Tuple[int, int, int, int] Absolute pixel coordinates (x1, y1, x2, y2) within the full image
expected_products List[str] Product names expected in this cell (from planogram config)
reference_image_keys List[str] Keys into reference_images dict for products in this cell
level Optional[str] None Shelf level or zone name, if applicable

Class GridType

Supported grid decomposition strategies.

Determines how the ROI is split into detection cells before LLM calls.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally