json2vgg

tomni.transformers.json2vgg(json_list: List[dict], image_name: str, extension: str = '.jpg', add_accuracy: bool = True)[source]

Transform a list of JSON annotations into a format compatible with ‘VGG Image Annotator’.

Parameters
  • json_list (List[dict]) – A list of JSON objects representing annotations in the standard AxionBio format.

  • image_name (str) – The name of the image to which the annotations will be overlaid within ‘VGG Image Annotator’.

  • extension (str, optional) – The file extension for the image. Defaults to “.jpg”.

  • add_accuracy (bool, optional) – If True, include an “accuracy” attribute in the region attributes of each annotation. If False, omit the accuracy attribute. Defaults to True.

Returns

A JSON object compatible with ‘VGG Image Annotator’ format, containing the image filename,

a list of regions (annotations), and file attributes.

Return type

dict