Labels acquisition format

Edge Impulse Exporter Format (info.labels)

The Edge Impulse Exporter acquisition format provides a simple and intuitive way to store files and associated labels (info.labels). Folders containing data in this format will take the following structure:

.
├── info.labels
└── training
│   ├── info.labels
│   ├── file1.wav
│   ├── file2.wav
│   ├── file3.wav
│   ...
│   └── file100.jpg
└── testing
    ├── info.labels
    ├── file101.wav
    ├── file102.wav
    ...
    └── file120.wav

2 directories, 123 files

The subdirectories contain files in any Edge Impulse-supported format (see above). Each file represents a sample and is associated with its respective labels in the info.labels file.

The info.labels file (can be located in each subdirectory or at the folder root) provides detailed information about the labels. 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 a supported file format and its associated labels.

    • path: The path or file name.

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

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

      • type: Specifies the type of label - unlabeled, label, multi-label

      • label (optional): The actual label or class name of the sample.

      • labels (optional): The labels in the multi-label format:

        • label: Label for the given period.

        • startIndex: Timestamp in milliseconds.

        • endIndex: Timestamp in milliseconds.

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

    • boundingBoxes (Optional): 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.

Edge Impulse Object Detection Labeling Format (bounding_boxes.labels)

Looking for more object detection formats?

See Image datasets annotation formats.

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"
            },
            "metadata": {
                "version": "2023-1234-LAB"
            },
            "boundingBoxes": [
                {
                    "label": "green",
                    "x": 105,
                    "y": 201,
                    "width": 91,
                    "height": 90
                },
                {
                    "label": "blue",
                    "x": 283,
                    "y": 233,
                    "width": 86,
                    "height": 87
                }
            ]
        },
        {
            "path": "cubes.23j3rclu.jpg",
            "category": "testing",
            "label": {
                "type": "label",
                "label": "cubes"
            },
            "metadata": {
                "version": "2023-4567-PROD"
            },
            "boundingBoxes": [
                {
                    "label": "red",
                    "x": 200,
                    "y": 206,
                    "width": 74,
                    "height": 75
                },
                {
                    "label": "yellow",
                    "x": 370,
                    "y": 245,
                    "width": 79,
                    "height": 73
                }
            ]
        }
    ] 
}

Edge Impulse Multi-labels Labeling Format (structured_labels.labels)

Want to learn more about Multi-labels feature?

See the dedicated documentation page: Multi-labels (Time-series)

If you want to use the Ingestion API, you need to use the structured_labels.labels format:

The structure and organization are designed to provide clear, index-based labeling for various segments of a data file.

The file structured_labels.labels follows this structure:

  • version: Indicates the version of the label format.

  • type: Specifies the type of labeling method - use structured-labels.

  • structuredLabels: This is an object that maps file names to arrays of labels. Where each key represents the name of a file, and its value is an array of objects, each containing:

    • startIndex and endIndex (milliseconds): These keys define the start and end of the segment within the file that the label applies to, allowing for precise segmentation of data. Note that no missing values are allowed. e.g. the next segment after "endIndex": 300 needs to be "startIndex": 301

    • label: A string that represents the label assigned to the range between startIndex and endIndex.

structured_labels.labels example:

{
    "version": 1,
    "type": "structured-labels",
    "structuredLabels": {
        "updown.3.json": [{
            "startIndex": 0,
            "endIndex": 300,
            "label": "first_label"
        }, {
            "startIndex": 301,
            "endIndex": 621,
            "label": "second_label"
        }]
    }
}

You can have a look at this tutorial for a better understanding: Ingest multi-label data with Edge Impulse API.

Last updated