Inference output

Inference output examples

Let's first start with some examples of output which may be easier to understand than the exact specifications below.

A typical output for a classification algorithm will look like this:

JSON
{
    "outputs": [{
        "labels": {
            "predicted": [{
                "label_name": "sunglasses",
                "label_id": 9,
                "score": 0.801353174,
                "threshold": 0.347
            },
            {
                "label_name": "glasses",
                "label_id": 8,
                "score": 0.175235228,
                "threshold": 0.139
            }],
            "discarded": []
        }
    }]
}

Prediction are displayed as soon as the prediction score is above the indicated threshold. The predictions are sorted by decreasing confidence, so you may only be interested in the first prediction outputs[0]['labels']['predicted'][0]['label_name'] for a classification problem. For a multi-label classification problem (tagging), all the predicted labels are independent and may be of interest.

The output of a detection algorithm is almost the same, see just below. Please note the presence of the roi field which indicate the location ("roi" stand for Region Of Interest) of the object in the image. The (xmin, ymin) coordinate of the box corresponds to its top-left corner.

JSON
{
    "outputs": [{
        "labels": {
            "predicted": [{
                "label_name": "sunglasses",
                "label_id": 9,
                "roi": {
                    "region_id": 1,
                    "bbox": {
                        "xmin": 0.312604159,
                        "ymin": 0.366485775,
                        "ymax": 0.5318923,
                        "xmax": 0.666821837
                    }
                },
                "score": 0.990304172,
                "threshold": 0.347
            }],
            "discarded": []
        }
    }]
}

Inference output specification

The data returned by an inference request will contain the list of inference outputs:

This object is directly related to the output object of the specification: they both have the same unique field. It stores the recognition inference output.

Inference labels output

Prediction

Stores information related to an object hypothesis.

ROI Object

ROI stands for Region Of Interest and describes the position of an object.

Last updated