Ango to Mask Converter

Overview

The Ango to Mask Converter plugin converts various annotation types including segmentation, polygon, and bounding box; from the Ango format into mask representations. It supports multiple data types and annotation tools, offering flexibility for processing images, videos, and multi-page assets.

Ango to Mask Converter (A) Annotations on Ango Hub image editor, (B) Output mask

Plugin Functionality

The Ango to Mask Converter plugin transforms annotations from the Ango format into mask representations, offering a highly configurable and efficient workflow for both image and video data. It provides flexible visualization, mapping, and logging options to meet diverse annotation and analysis needs.

  • Converts annotations into mask images using flexible color-mapping strategies to represent each class or instance clearly and consistently.

  • Allows users to include or prioritize specific annotation categories when generating masks, ensuring only relevant data is processed.

  • Optionally adds distinct outlines around objects to improve mask visibility and better separate adjacent regions.

  • Can overlay generated masks directly on top of the original media, with adjustable opacity to balance visibility between the source image and the mask.

  • Allows generated masks to be displayed directly over the original media, with adjustable opacity for optimal balance between the mask and the source media.

Supported Data Types

  • Image

  • Video

  • Multi-Image Assets

Supported Annotation Tools

  • Polygon

  • Segmentation

  • Point

  • Polyline

  • Bounding Box

  • Rotated Bounding Box

  • Brush (For image assets only)

Plugin Configuration

From the Stage Filter field, pick the stages containing the tasks you'd like to get the export of. Similarly, from the Batch Filter field, you may select one or more batches the tasks of which will be exported. By default, all tasks are exported from all batches.

If you wish to receive an email when the export is complete, toggle Send Email on.

You may vary a number of settings related to your export from the Config JSON field. Each option is detailed below:

{
  "class_mapping_type": "project_colors",
  "selected_schema_ids": [],
  "prioritized_schema_ids": [],
  "add_boundary": false,
  "polyline_format": "line",
  "polyline_thickness": 5,
  "include_key_frames_only": true,
  "verbose": false,
  "verbose_frequency": 1000,
  "overlay_over_image": false,
  "overlay_opacity": 0.5
}
  • "class_mapping_type": Defines how classes are mapped to the mask output.

    • Options:

      • "single_channel_sequential"

      • "single_channel_diverging"

      • "multi_channel_qualitative"

      • "project_colors"

      • "instance_segmentation"

    • Example:

      • "class_mapping_type": "project_colors"

    • Descriptions:

single_channel_sequential: Assigns grayscale values sequentially in a single channel.

Example: Class-1: [1], Class-2: [2], Class-3: [3]

Output mask with "class_mapping_type": "single_channel_sequential" option

single_channel_diverging: Uses diverging grayscale values for enhanced distinction.

Example: Class-1: [256], Class-2: [128], Class-3: [64]

Output mask with "class_mapping_type": "single_channel_diverging" option

multi_channel_qualitative: Maps each class to matplotlibs color schemas: 'tab10', 'tab20', 'tab20b', 'tab20c', and ‘xkcd-colors’ respectively.

Example: Class-1: [31, 119, 180], Class-2: [255, 127, 14]

Output mask with "class_mapping_type": "multi_channel_qualitative" option

project_colors: Uses project-defined colors for mask generation.

Example: Class-1: [244, 67, 54], Class-2: [3, 169, 244]

Output mask with "class_mapping_type": "project_colors" option

instance_segmentation: Assigns a distinct RGB color to each instance.

Example: Cat-1: [31, 199, 180], Dog-1: [255, 127, 14], Dog-2: [44, 160, 44]

Output mask with "class_mapping_type": "instance_segmentation" option

  • "selected_schema_ids": A list of schema IDs to specify which classes should be processed. Only annotations matching these IDs will be considered.

    • Example:

      • "selected_schema_ids": ["1234", "1235"]

  • "prioritized_schema_ids": A list of schema IDs that defines which annotations take precedence when multiple annotations overlap. Note: By default, the tools are sorted according to their tool type. The sorting order from back to front is as follows: brush, bounding box, rotated bounding box, polygon, segmentation, polyline, point

    • Example:

      • "prioritized_schema_ids": ["1234", "1235"]

  • "add_boundary": Boolean value (true or false). If enabled, adds boundaries to annotations for better visualization in the generated masks. Supported for polygon, segmentation, bounding box, and rotated bounding box.

    • Example:

      • "add_boundary": true

      • "add_boundary": false

(A) Output mask with "add_boundary": false option and (B) Output mask with "add_boundary": true option

  • "polyline_format": Specifies how polyline annotations are represented in the output mask. The "line" option draws only the connecting lines between points, "point" marks only the individual points of the polyline, and "line+point" includes both the connecting lines and their defining points.

    • Options:

      • "line"

      • "point"

      • "line+point"

    • Example:

      • "polyline_format": "line"

  • "polyline_thickness": Specifies the thickness of the boundary lines (in pixels) for polyline or segmentation annotations.

    • Example:

      • "polyline_thickness": 5

  • "include_key_frames_only": Specifies whether only key frames should be included in the metrics calculation. (For video assets only)

    • Example:

      • "include_key_frames_only": true

      • "include_key_frames_only": false

  • "verbose": Boolean flag (true or false). When enabled, detailed logs are produced during the mask generation process.

    • Example:

      • "verbose": true

      • "verbose": false

  • "verbose_frequency": Integer value specifying how frequently logs should be generated during processing. For example, setting verbose_frequency=5 will log progress for every 5th asset.

    • Example:

      • "verbose_frequency": 100

  • "overlay_over_image": Boolean value (true or false). When enabled, the generated mask will be overlaid on the original image or video for easy comparison.

    • Example:

      • "overlay_over_image": true

      • "overlay_over_image": false

(A) Output mask with "overlay_over_image": false option and (B) Output mask with "overlay_over_image": true option

  • "overlay_opacity": Float value between 0 and 1 that controls the transparency of the overlay. A value of 0 means the mask is fully transparent, while 1 means it is fully opaque.

    • Example:

      • "overlay_opacity": 0.5

Last updated