Skip to content

API Reference parrot_pipelines.planogram.identification.identify

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

parrot_pipelines.planogram.identification.identify

View source

Stage 2 — structured-input / structured-output identification (full image or Set-of-Marks strips).

Alias AddedShape

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

Alias CycleContext

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

Attribute DUPLICATE_IOU

Type: float

Alias Descriptors

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

Attribute IDENTIFY_PROMPT_VERSION

Type: str

Attribute IDENTIFY_STAGE

Type: str

Alias Identification

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

Alias IdentificationResponse

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

Alias IdentificationResult

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

Alias ObservationSource

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

Alias PerceptionResult

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

Attribute PixelBox

Attribute SLOT_CROP_PAD

Type: float

Alias Shape

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

Alias ShapeKind

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

Alias Slot

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

Attribute Target

Attribute UNREFERENCED_RESPONSE

Type: Type[BaseModel]

Alias VisionError

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

Alias assign_membership

Re-exported from parrot_pipelines.planogram.perception.membership.assign_membership.

Function build_identify_prompt

Build provider-neutral identify-v2-ocr instructions and own-area OCR/confidence.

build_identify_prompt(targets: Sequence[Dict[str, Any]], vocabulary: Sequence[str], *, reference_labels: Sequence[str] = ()) -> str

Parameter Type Default Description
targets Sequence[Dict[str, Any]] {"id", "mark", "box_2d", "ocr_text"[, "ocr_confidence", "tag_text"]} per area.
vocabulary Sequence[str] Descriptor field names to report (names only, never values).
reference_labels Sequence[str] () Opaque labels of reference images attached after the main image.

Returns: str — Prompt text that never names placement expectations or catalogue keys.

Alias encode_png

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

Alias from_strip_norm

Re-exported from parrot_pipelines.planogram.perception.slots.from_strip_norm.

Function identify_full_image

One call: whole image + stage-1 JSON. Boxes are normalised against the full image.

identify_full_image(image: np.ndarray, perception: PerceptionResult, ctx: CycleContext, *, vocabulary: Sequence[str]) -> IdentificationResult

Parameter Type Default Description
image np.ndarray Untouched full-resolution BGR image.
perception PerceptionResult Stage-1 output of the image.
ctx CycleContext Per-run services (vision adapter, CPU executor, error sink).
vocabulary Sequence[str] Descriptor fields to report.

Returns: IdentificationResult — The validated identification result.

Function identify_slots

Identify each target in its own padded crop with source-coordinate validation.

identify_slots(image: np.ndarray, perception: PerceptionResult, ctx: CycleContext, *, vocabulary: Sequence[str], marks: bool = True) -> IdentificationResult

Parameter Type Default Description
image np.ndarray Untouched full-resolution BGR image.
perception PerceptionResult Stage-1 output of the image.
ctx CycleContext Per-run services, profile and reference bank.
vocabulary Sequence[str] Descriptor fields to report.
marks bool True Draw the numbered outline on each crop.

Returns: IdentificationResult — Validated identifications with isolated per-target errors.

Function identify_strips

One call per row (sub-strips above the cap), concurrently; a failed strip is isolated.

identify_strips(image: np.ndarray, perception: PerceptionResult, ctx: CycleContext, *, vocabulary: Sequence[str], marks: bool = True, substrip_max_slots: int = 8) -> IdentificationResult

Parameter Type Default Description
image np.ndarray Untouched full-resolution BGR image.
perception PerceptionResult Stage-1 output of the image.
ctx CycleContext Per-run services (vision adapter, CPU executor, error sink).
vocabulary Sequence[str] Descriptor fields to report.
marks bool True Draw numbered Set-of-Marks outlines on each strip.
substrip_max_slots int 8 Maximum targets per call.

Returns: IdentificationResult — The validated identification result.

Attribute logger

Function render_marked_strip

Crop strip and draw a numbered outline per mark; PNG bytes. Picklable — runs in the CPU executor.

An empty marks list yields the plain crop. Labels are drawn at the BOTTOM edge of each box so the product face is never covered, and are sized relative to the box (see _mark_style) so they stay legible after the vision provider downscales the strip.

render_marked_strip(image: np.ndarray, strip: PixelBox, marks: List[Tuple[int, PixelBox]]) -> bytes

Parameter Type Default Description
image np.ndarray Full-resolution BGR image.
strip PixelBox (x1, y1, x2, y2) crop in source pixels.
marks List[Tuple[int, PixelBox]] (number, (x1, y1, x2, y2)) in source pixels.

Returns: bytes — PNG bytes of the (marked) crop.

Alias select_references

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

Alias strip_box

Re-exported from parrot_pipelines.planogram.perception.slots.strip_box.

Alias to_strip_norm

Re-exported from parrot_pipelines.planogram.perception.slots.to_strip_norm.

Alias usable_shapes

Re-exported from parrot_pipelines.planogram.perception.membership.usable_shapes.

Function validate_response

Validate a response using legacy targets and preserve the public API.

validate_response(response: IdentificationResponse, perception: PerceptionResult, *, strip: Optional[DetectionBox], next_shape_id: Callable[[], str]) -> Tuple[List[Identification], List[Shape], List[str]]

Parameter Type Default Description
response IdentificationResponse
perception PerceptionResult
strip Optional[DetectionBox]
next_shape_id Callable[[], str]

Returns: Tuple[List[Identification], List[Shape], 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