Skip to content

Rich Label Visualization

Class: RichLabelVisualizationBlockV1

Source: inference.core.workflows.core_steps.visualizations.rich_label.v1.RichLabelVisualizationBlockV1

Draw text labels on detected objects using high-quality TrueType font rendering. This block is the rich-text counterpart of the Label Visualization block: instead of OpenCV's built-in bitmap font, it renders labels with Pillow through Supervision's RichLabelAnnotator, producing anti-aliased, professional-looking text suitable for production UIs, reports and customer-facing imagery.

How This Block Works

This block takes an image and detection predictions and draws text labels on each detected object. The block:

  1. Takes an image and predictions as input
  2. Extracts label text for each detection based on the selected text option (class name, confidence, tracker ID, dimensions, area, time in zone, or index)
  3. Resolves the selected font_family identifier to an approved font shipped with inference
  4. Determines label position based on the selected anchor point
  5. Applies background color styling based on the selected color palette, with colors assigned by class, index, or track ID
  6. Renders anti-aliased text labels with the selected font, size, color, padding and border radius using Supervision's RichLabelAnnotator
  7. Returns an annotated image with text labels overlaid on the original image

Approved Fonts

Fonts are selected with the font_family parameter. Only fonts approved and distributed with inference can be used - arbitrary font files, filesystem paths and remote font URLs are not supported. This keeps rendering deterministic and avoids parsing untrusted font files. Official Docker images and wheels ship with all approved fonts included; on bare source checkouts a missing font is fetched on first use from its pinned, checksum-verified source (disable with ALLOW_WORKFLOWS_FONTS_DOWNLOAD=False). All approved fonts are licensed under the SIL Open Font License 1.1 and ship with their license texts.

Fonts are selected by display name. 20 fonts are available:

Monospaced: Geist Mono (default, by Vercel), Anonymous Pro, Courier Prime, Fira Code, IBM Plex Mono, Inconsolata, JetBrains Mono, PT Mono, Roboto Mono, Source Code Pro, Space Mono.

Sans serif: Geist, Inter, Lato, Montserrat, Noto Sans, Nunito Sans, Open Sans, Roboto, Work Sans.

Legacy snake_case identifiers (e.g. geist_mono) are still accepted and normalized to the display name.

Noto Sans offers the broadest character coverage (Latin, Greek, Cyrillic). Characters not covered by the selected font render as the font's missing-glyph symbol (typically an empty box) - pick Noto Sans when annotating non-Latin text.

Comparison with Label Visualization

  • Label Visualization (roboflow_core/label_visualization@v1) uses OpenCV's Hershey fonts - fast, but aliased and pixelated, with no font choice.
  • Rich Label Visualization (this block) uses TrueType fonts rendered by Pillow - higher-quality anti-aliased output, selectable fonts, Unicode support and optional text wrapping (max_line_length), at a small additional rendering cost per frame.

Common Use Cases

  • Customer-facing visualizations: Render detection overlays that match your product's typography (e.g. Geist Mono) for websites, dashboards and reports
  • High-quality reporting: Produce publication-ready annotated images with readable, anti-aliased labels
  • Non-Latin text: Render labels containing Greek or Cyrillic characters with Noto Sans

Type identifier

Use the following identifier in step "type" field: roboflow_core/rich_label_visualization@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
copy_image bool Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations..
color_palette str Select a color palette for the visualised elements..
palette_size int Specify the number of colors in the palette. This applies when using custom or Matplotlib palettes..
custom_colors List[str] Define a list of custom colors for bounding boxes in HEX format..
color_axis str Choose how bounding box colors are assigned..
text str Content to display in text labels. Options: 'Class' (class name), 'Confidence' (confidence score), 'Class and Confidence' (both), 'Tracker Id' (tracking ID for tracked objects), 'Time In Zone' (time spent in zone), 'Dimensions' (center coordinates and width x height), 'Area' (bounding box area in pixels), 'Area (mask)' (mask area in pixels from Mask Area Measurement block), 'Area (converted)' (mask area in converted units from Mask Area Measurement block), or 'Index' (detection index)..
text_position str Anchor position for placing labels relative to each detection's bounding box. Options include: CENTER (center of box), corners (TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT), edge midpoints (TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, BOTTOM_CENTER), or CENTER_OF_MASS (center of mass of the object)..
text_color str Color of the label text. Can be a color name (e.g., 'WHITE', 'BLACK') or color code in HEX format (e.g., '#FFFFFF') or RGB format (e.g., 'rgb(255, 255, 255)')..
font_family str Font used to render label text. Pick from approved fonts shipped with inference. Arbitrary font files or URLs are not supported. Pick 'Noto Sans' for the broadest character coverage..
text_size_mode str How label text size is chosen. 'Manual' uses Size directly. 'Automatic' picks a readable size from image resolution and treats Size as a multiplier around the 1080p baseline (14 pt)..
font_size int Font size of the label text, in points. In Manual mode this is the rendered size. In Automatic mode this multiplies the resolution-derived baseline (14 pt at 1080p min dimension)..
text_padding int Padding around the text in pixels. Controls the spacing between the text and the label background border..
border_radius int Border radius of the label background in pixels. Set to 0 for square corners. Higher values create more rounded corners for a softer appearance..
max_line_length int Maximum number of characters per line before the label text wraps. Leave empty to disable wrapping..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Available Connections

Compatible Blocks

Check what blocks you can connect to Rich Label Visualization in version v1.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Rich Label Visualization in version v1 has.

Bindings
  • input

    • image (image): The image to visualize on..
    • copy_image (boolean): Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations..
    • predictions (Union[instance_segmentation_prediction, keypoint_detection_prediction, rle_instance_segmentation_prediction, object_detection_prediction]): Model predictions to visualize..
    • color_palette (string): Select a color palette for the visualised elements..
    • palette_size (integer): Specify the number of colors in the palette. This applies when using custom or Matplotlib palettes..
    • custom_colors (list_of_values): Define a list of custom colors for bounding boxes in HEX format..
    • color_axis (string): Choose how bounding box colors are assigned..
    • text (string): Content to display in text labels. Options: 'Class' (class name), 'Confidence' (confidence score), 'Class and Confidence' (both), 'Tracker Id' (tracking ID for tracked objects), 'Time In Zone' (time spent in zone), 'Dimensions' (center coordinates and width x height), 'Area' (bounding box area in pixels), 'Area (mask)' (mask area in pixels from Mask Area Measurement block), 'Area (converted)' (mask area in converted units from Mask Area Measurement block), or 'Index' (detection index)..
    • text_position (string): Anchor position for placing labels relative to each detection's bounding box. Options include: CENTER (center of box), corners (TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT), edge midpoints (TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, BOTTOM_CENTER), or CENTER_OF_MASS (center of mass of the object)..
    • text_color (string): Color of the label text. Can be a color name (e.g., 'WHITE', 'BLACK') or color code in HEX format (e.g., '#FFFFFF') or RGB format (e.g., 'rgb(255, 255, 255)')..
    • font_family (string): Font used to render label text. Pick from approved fonts shipped with inference. Arbitrary font files or URLs are not supported. Pick 'Noto Sans' for the broadest character coverage..
    • text_size_mode (string): How label text size is chosen. 'Manual' uses Size directly. 'Automatic' picks a readable size from image resolution and treats Size as a multiplier around the 1080p baseline (14 pt)..
    • font_size (integer): Font size of the label text, in points. In Manual mode this is the rendered size. In Automatic mode this multiplies the resolution-derived baseline (14 pt at 1080p min dimension)..
    • text_padding (integer): Padding around the text in pixels. Controls the spacing between the text and the label background border..
    • border_radius (integer): Border radius of the label background in pixels. Set to 0 for square corners. Higher values create more rounded corners for a softer appearance..
    • max_line_length (integer): Maximum number of characters per line before the label text wraps. Leave empty to disable wrapping..
  • output

    • image (image): Image in workflows.
Example JSON definition of step Rich Label Visualization in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/rich_label_visualization@v1",
    "image": "$inputs.image",
    "copy_image": true,
    "predictions": "$steps.object_detection_model.predictions",
    "color_palette": "DEFAULT",
    "palette_size": 10,
    "custom_colors": [
        "#FF0000",
        "#00FF00",
        "#0000FF"
    ],
    "color_axis": "CLASS",
    "text": "LABEL",
    "text_position": "CENTER",
    "text_color": "WHITE",
    "font_family": "Geist Mono",
    "text_size_mode": "Manual",
    "font_size": 14,
    "text_padding": 10,
    "border_radius": 0,
    "max_line_length": 30
}