datumaro.plugins.data_formats.coco.page_mapper#

Classes

COCOPageMapper(path)

Construct page maps for items and annotations from the JSON file, which are used for the stream importer.

class datumaro.plugins.data_formats.coco.page_mapper.COCOPageMapper(path: str)[source]#

Bases: object

Construct page maps for items and annotations from the JSON file, which are used for the stream importer.

It also provides __iter__() to produce item and annotation dictionaries in stream manner after constructing the page map.

get_item_dict(item_key: int) Dict | None[source]#
get_anns_dict(item_key: int) List[Dict] | None[source]#
iter_item_ids() Iterator[int][source]#
stream_parse_categories_data() Dict[str, Any][source]#

Parse “categories” section from the given JSON file using the stream json parser

datumaro.plugins.data_formats.coco.page_mapper.CocoPageMapperImpl#

alias of CocoPageMapper