Image dataset annotation format

Image datasets can be found in a range of different formats. Different formats have different directory structures and require annotations (or labels) to follow a particular structure.

Image datasets usually consist of a bunch of image files, and one (or many) annotation files, which provide labels for the images. Image datasets may have annotations that consist of:

  • A single-label: each image has a single label.

  • Bounding boxes: used for object detection; images contain 'objects' to be detected, given as a list of labeled 'bounding boxes'.

We support uploading data in many different formats in the Edge Impulse, either through the Edge Impulse Studio uploader or through the CLI Uploader.

Below are the different image dataset annotation format that we officially support:

Edge Impulse object detection format

The Edge Impulse object detection acquisition format provides a simple and intuitive way to store images and associated bounding box labels. Folders containing data in this format will take the following structure:

.
├── testing
│   ├── bounding_boxes.labels
│   ├── cubes.23im33f2.jpg
│   ├── cubes.23j3rclu.jpg
│   ├── cubes.23j4jeee.jpg
│   ...
│   └── cubes.23j4k0rk.jpg
└── training
    ├── bounding_boxes.labels
    ├── blue.23ijdngd.jpg
    ├── combo.23ijkgsd.jpg
    ├── cubes.23il4pon.jpg
    ├── cubes.23im28tb..jpg
    ...
    └── yellow.23ijdp4o.jpg

2 directories, 73 files

The subdirectories contain image files in JPEG or PNG format. Each image file represents a sample and is associated with its respective bounding box labels in the bounding_boxes.labels file.

The bounding_boxes.labels file in each subdirectory provides detailed information about the labeled objects and their corresponding bounding boxes. The file follows a JSON format, with the following structure:

  • version: Indicates the version of the label format.

  • files: A list of objects, where each object represents an image and its associated labels.

    • path: The path or file name of the image.

    • category: Indicates whether the image belongs to the training or testing set.

    • (optional) label: Provides information about the labeled objects.

      • type: Specifies the type of label (e.g., a single label).

      • label: The actual label or class name of the object.

    • (Optional) metadata: Additional metadata associated with the image, such as the site where it was collected, the timestamp or any useful information.

    • boundingBoxes: A list of objects, where each object represents a bounding box for an object within the image.

      • label: The label or class name of the object within the bounding box.

      • x, y: The coordinates of the top-left corner of the bounding box.

      • width, height: The width and height of the bounding box.

bounding_boxes.labels example:

{
    "version": 1,
    "files": [
        {
            "path": "cubes.23im33f2.jpg",
            "category": "testing",
            "label": {
                "type": "label",
                "label": "cubes"
            },