Skip to content

API Reference parrot_pipelines.planogram.plan

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

parrot_pipelines.planogram.plan

View source

Alias AbstractPipeline

Re-exported from parrot_pipelines.abstract.AbstractPipeline.

Alias AssessmentStatus

Re-exported from parrot_pipelines.planogram.contracts.AssessmentStatus.

Alias ComparisonResult

Re-exported from parrot_pipelines.planogram.contracts.ComparisonResult.

Alias CpuExecutor

Re-exported from parrot_pipelines.planogram.perception.executor.CpuExecutor.

Alias CreditPolicy

Re-exported from parrot_pipelines.planogram.contracts.CreditPolicy.

Alias CycleContext

Re-exported from parrot_pipelines.planogram.contracts.CycleContext.

Alias EndcapBacklitMultitier

Re-exported from parrot_pipelines.planogram.types.EndcapBacklitMultitier.

Alias EndcapNoShelvesPromotional

Re-exported from parrot_pipelines.planogram.types.EndcapNoShelvesPromotional.

Alias EvidenceWeights

Re-exported from parrot_pipelines.planogram.contracts.EvidenceWeights.

Alias GENERIC_DETECTION_PROMPT

Re-exported from parrot_pipelines.planogram.identification.detector.GENERIC_DETECTION_PROMPT.

Alias GraphicPanelDisplay

Re-exported from parrot_pipelines.planogram.types.GraphicPanelDisplay.

Alias IdentificationResult

Re-exported from parrot_pipelines.planogram.contracts.IdentificationResult.

Attribute ImageInput

Alias InkWall

Re-exported from parrot_pipelines.planogram.types.InkWall.

Alias LayoutProfile

Re-exported from parrot_pipelines.planogram.layout.LayoutProfile.

Attribute MIGRATION_RUNBOOK

Alias ObservationSource

Re-exported from parrot_pipelines.planogram.contracts.ObservationSource.

Alias OcrReader

Re-exported from parrot_pipelines.planogram.perception.ocr.OcrReader.

Alias PerceptionResult

Re-exported from parrot_pipelines.planogram.contracts.PerceptionResult.

Class PlanogramCompliance

Pure-LLM Planogram Compliance Pipeline with Composable Delegation.

Uses the Composable Pattern: PlanogramCompliance remains the single public entry point. Internally it resolves a type-specific composable class (e.g. ProductOnShelves, InkWall) from planogram_type in the config and delegates all type-specific steps to it.

Parameter Type Default Description
planogram_config PlanogramConfig The planogram configuration (llm_backend feeds backend resolution).
llm Any None A client instance or a "provider:model" string.
llm_provider Union[str, _Unset] UNSET Explicit provider (UNSET when omitted).
llm_model Union[str, None, _Unset] UNSET Explicit model (UNSET when omitted).
cpu_workers int 2 Worker processes of the per-run CPU executor.
llm_concurrency int 4 Concurrent vision calls per run.
llm_timeout float 120.0 Timeout of one vision call (seconds).
vision_cache_dir Optional[Path] None Optional response cache directory for the vision adapter.
enabled_ocr Optional[bool] None Enable optional local RapidOCR detection. Disabled by default; the LLM still identifies products and occupancy when local OCR is disabled.
**kwargs Any {} Forwarded to the client constructor.

Method PlanogramCompliance.uses_reference_images

Return whether a planogram type consumes reference images.

Callers (e.g. Flowtask) use it to skip resolving and loading reference images for types that identify products without them, such as ink_wall.

uses_reference_images(planogram_type: Optional[str] = None, planogram_config: Optional[Dict[str, Any]] = None) -> bool

Parameter Type Default Description
planogram_type Optional[str] None Planogram type name; None means product_on_shelves.
planogram_config Optional[Dict[str, Any]] None The configuration's planogram_config dict; its layout_profile may override the type default (references.enabled).

Returns: bool — True when the resolved layout profile enables reference selection.

Raises:

  • ValueError — Unknown planogram type or an invalid layout_profile override.

Method PlanogramCompliance.run

Run the perceive -> identify -> compare cycle on one image or several photos of one fixture.

run(image: Union[ImageInput, Sequence[ImageInput]], output_dir: Optional[Union[str, Path]] = None, image_id: Optional[Union[str, Sequence[str]]] = None, **kwargs: Any) -> Dict[str, Any]

Parameter Type Default Description
image Union[ImageInput, Sequence[ImageInput]] One image (path or PIL image) or a sequence of photos of the same fixture.
output_dir Optional[Union[str, Path]] None Optional directory for debug and render files.
image_id Optional[Union[str, Sequence[str]]] None One id, or a sequence matching image (default img0..imgN).
**kwargs Any {} Accepted and ignored (backwards compatibility).

Returns: Dict[str, Any] — The 8 legacy keys plus the additive keys (detections, identifications, position_results, shelf_scores, coverage, detected_products, definition_coverage, assessment_status, strict_compliance_score, evidence_quality, detection_source, ocr_available, resolved_backend, renders, errors).

Raises:

  • ValueError — image_id is a sequence whose length differs from image.

Method PlanogramCompliance.render_evaluated_image

Render compliance evaluation overlay on the image.

Uses colors from self._type_handler.get_render_colors() for type-specific color schemes.

render_evaluated_image(image: Union[str, Path, Image.Image], *, shelf_regions: Optional[List[ShelfRegion]] = None, detections: Optional[List[DetectionBox]] = None, identified_products: Optional[List[IdentifiedProduct]] = None, mode: str = 'identified', show_shelves: bool = True, save_to: Optional[Union[str, Path]] = None) -> Image.Image

Parameter Type Default Description
image Union[str, Path, Image.Image]
shelf_regions Optional[List[ShelfRegion]] None
detections Optional[List[DetectionBox]] None
identified_products Optional[List[IdentifiedProduct]] None
mode str 'identified'
show_shelves bool True
save_to Optional[Union[str, Path]] None

Returns: Image.Image

Alias PlanogramConfig

Re-exported from parrot_pipelines.models.PlanogramConfig.

Alias ProductCounter

Re-exported from parrot_pipelines.planogram.types.ProductCounter.

Alias ProductOnShelves

Re-exported from parrot_pipelines.planogram.types.ProductOnShelves.

Alias RenderRecord

Re-exported from parrot_pipelines.planogram.contracts.RenderRecord.

Alias ShapeKind

Re-exported from parrot_pipelines.planogram.contracts.ShapeKind.

Alias Slot

Re-exported from parrot_pipelines.planogram.contracts.Slot.

Alias SlotsDefinition

Re-exported from parrot_pipelines.planogram.comparison.definition.SlotsDefinition.

Alias SlotsDefinitionError

Re-exported from parrot_pipelines.planogram.comparison.definition.SlotsDefinitionError.

Alias UNSET

Re-exported from parrot_pipelines.planogram.backend.UNSET.

Alias VisionAdapter

Re-exported from parrot_pipelines.planogram.identification.vision.VisionAdapter.

Alias count_usable_targets

Re-exported from parrot_pipelines.planogram.stages.perceive.count_usable_targets.

Alias definition_coverage

Re-exported from parrot_pipelines.planogram.comparison.definition.definition_coverage.

Alias llm_detect_shapes

Re-exported from parrot_pipelines.planogram.identification.detector.llm_detect_shapes.

Alias load_reference_bank

Re-exported from parrot_pipelines.planogram.identification.references.load_reference_bank.

Alias load_slots_definition

Re-exported from parrot_pipelines.planogram.comparison.definition.load_slots_definition.

Alias rebuild_geometry

Re-exported from parrot_pipelines.planogram.stages.perceive.rebuild_geometry.

Alias render_roi_prompt

Re-exported from parrot_pipelines.planogram.identification.detector.render_roi_prompt.

Alias resolve_layout_profile

Re-exported from parrot_pipelines.planogram.layout.resolve_layout_profile.

Alias validate_bindings

Re-exported from parrot_pipelines.planogram.comparison.definition.validate_bindings.

Alias validate_zone_selectors

Re-exported from parrot_pipelines.planogram.layout.validate_zone_selectors.

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