Skip to content

API Reference parrot_pipelines.planogram.identification.references

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

parrot_pipelines.planogram.identification.references

View source

Per-run reference-image bank and expectation-free selection (FEAT-612, spec §2 Stage 2 / Module 3).

Alias CycleContext

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

Attribute LABEL_FORMAT

Type: str

Alias OcrReading

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

Alias ReferenceImage

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

Alias ReferencePolicy

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

Alias encode_png

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

Function encode_reference_bytes

Decode encoded image bytes and re-encode them as PNG.

encode_reference_bytes(data: bytes) -> bytes

Parameter Type Default Description
data bytes

Returns: bytes

Function flatten_references

Flatten catalogue entries in sorted-key and stable-list order.

flatten_references(reference_images: Mapping[str, Any]) -> List[Tuple[str, Any]]

Parameter Type Default Description
reference_images Mapping[str, Any]

Returns: List[Tuple[str, Any]]

Function load_reference_bank

Load and encode all valid references once, preserving stable flattened labels.

load_reference_bank(reference_images: Mapping[str, Any], ctx: CycleContext) -> List[ReferenceImage]

Parameter Type Default Description
reference_images Mapping[str, Any]
ctx CycleContext

Returns: List[ReferenceImage]

Attribute logger

Function reference_label

Return an opaque, stable label for a one-based flattened index.

reference_label(index: int) -> str

Parameter Type Default Description
index int

Returns: str

Function select_references

Select a stable capped subset using only current-call OCR readings.

select_references(bank: Sequence[ReferenceImage], readings: Mapping[str, OcrReading], policy: ReferencePolicy) -> Tuple[List[ReferenceImage], List[str]]

Parameter Type Default Description
bank Sequence[ReferenceImage]
readings Mapping[str, OcrReading]
policy ReferencePolicy

Returns: Tuple[List[ReferenceImage], List[str]]

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