Skip to main content

Custom Metadata

Metadata can be customized as needed using: meta dictionaries:

  • As a top-level key for metadata applying to entire frame
  • In rois dictionaries, for metadata applying to individual ROIs.


Adding Frame Metadata

When instantiating a Frame, metadata that applies for the entire frame can be added as an argument.

from allegroai import SingleFrame

# create a frame with metadata
frame = SingleFrame(
# insert metadata dictionary

# add metadata to the frame
frame.metadata['dangerous'] = 'no'

Adding ROI Metadata

Metadata can be added to individual ROIs when adding an annotation to a frame, using the SingleFrame.add_annotation method.

frame.add_annotation(box2d_xywh=(10, 10, 30, 20), labels=['tiger'],
# insert metadata dictionary