Load new datasets¶
-
mira.datasets.
load_coco
(annotations_file, image_dir, categories=None)[source]¶ Obtain a scene collection from a COCO JSON file.
- Parameters
annotations_file (
str
) – The annotation file to loadimage_dir (
str
) – The directory in which to look for imagescategories (
Optional
[Categories
]) – The annotation configuration to use. If None, it is inferred from the annotations category file.
- Return type
SceneCollection
- Returns
A scene collection
-
mira.datasets.
load_voc
(filepaths, categories, image_dir=None)[source]¶ Read a scene from a VOC XML annotation file. Remaining arguments passed to scene constructor.
- Parameters
filepaths (
List
[str
]) – A list of VOC files to readimage_folder – Folder in which to look for images. Defaults to same folder as XML file prepended to the folder specified in the XML file.
categories (
Categories
) – The annotation configuration to use.
- Return type
SceneCollection
- Returns
A new scene collection, one scene per VOC file