SegmentationAnnotation

class scenebox.models.annotation.SegmentationAnnotation(labels, mask_colors, mask_urls=None, mask_uris=None, mask_file_paths=None, mask_ids=None, mask_types=None, confidences=None, attributes_list=None, **kwargs)

Create a Segmentation annotation.

Mask segments are automatically extracted from the provided mask images (each containing colored segments) supplied in mask_url/uri/file_paths. Mask attributes are interpreted in the order passed (the first label listed in``labels`` is associated with the first mask color listed in mask_colors, etc.)

Parameters:
  • labels – Names of each of the segmented regions.

  • mask_colors – Colors of the segmented regions. Colors must be represented in hex format.

  • mask_urls – URLs of the mask images. Each mask must contain its associated color listed in mask_colors.

  • mask_uris – URIs of the mask images. Each mask must contain its associated color listed in mask_colors.

  • mask_file_paths – Filepaths of the mask images. Each mask must contain its associated color listed in mask_colors.

  • mask_ids – IDs to give to the generated masks.

  • mask_types – Denotes the mask image color scheme. There are two accepted mask color schemes: “MultiColor”, or “SingleColor”. A “MultiColor” mask image may contain several colors (but must include its respective mask_colors color - these areas denote the mask region). A “SingleColor” mask only contains transparent and white colors (White areas denote the mask region). All entries of this list must be either “Multicolor” or “SingleColor”.

  • confidences – Labelling confidence. Must be between 0 and 1.

  • attributes_list – List of attributes

  • **kwargs – Additional annotation attributes. The keyword arguments are passed to scenebox.models.annotation.

Methods

to_dic

return a dictionary object representative of Annotation :return: dictionary object

to_dic()

return a dictionary object representative of Annotation :return: dictionary object