Skip to content

[Feature]: Add PercentageBar annotation renderer for proportional confidence and metric indicators #103

Description

@warun7

Summary

Add a dedicated PercentageBar annotation renderer to visualize detection confidence scores, model tracking probabilities, or custom progression values as proportional metric bars anchored to detection bounding boxes.

Motivation & Use Cases

  • Many computer vision applications benefit from showing model confidence or metric percentages directly on bounding boxes without cluttering text labels.
  • Supports flexible placement options (Top, Bottom, InsideTop, InsideBottom), configurable dimensions, border strokes, and custom opacity.
  • Preserves the session-first presentation model where renderers remain presentation-only and decoupled from core detection semantics.

Proposed Solution

  1. Core Styles & Contracts:

    • Introduce PercentageBarStyle, PercentageBarPlacement, and PercentageBarDrawInstruction types.
    • Implement BasePercentageBarStyle with automatic value clamping in [0, 1], bounding box offset math, and placement alignment.
    • Provide the annotationRenderers.percentageBar({ style }) factory and presentation normalizers.
  2. Vector Layer Lowering:

    • Lower PercentageBarDrawInstruction into closed background tracks and progress fill paths rendered via Pixi vector layers.
    • Wire percentageBarStyle through MediaRendererPresentation and the vector renderer layer.
  3. Documentation & Playground:

    • Add a dedicated documentation page with an interactive live playground.
    • Expose playground controls (height, fill opacity, placement) in the demo workbench.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions