Recognition Version

Version object

Definition

A recognition version implements a specification: this is the link between a specification and a neural network.

Post-processing

The fields of this object are mutually exclusive: you must specify exactly one of them.

Classification post-processing

Detection post-processing

You must specify exactly one of the anchored_output, direct_output or yolo_output fields. When we specify an expected tensor size in the description of those fields, we omit the first dimension of the tensor (i.e. the batch size).

Definition

Creates a new recognition version.

cURL
POST https://api.deepomatic.com/v0.7/recognition/versions

Arguments

Code sample

curl https://api.deepomatic.com/v0.7/recognition/versions \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}" \
-d '{
"spec_id": 42,
"network_id": 123,
"post_processings": [{"classification": {"output_tensor": "inception_v3/logits/predictions", "thresholds": [0.025, 0.025]}}]
}' \
-H "Content-Type: application/json"

Response

A recognition version object.

JSON
{
    "id": 1,
    "spec_id": 42,
    "spec_name": "hot-dog VS not hot-dog classifier",
    "network_id": 123,
    "network_name": "hot-dog VS not hot-dog classifier",
    "update_date": "2018-03-09T18:30:43.404610Z",
    "post_processings": [{
        "classification": {
            "output_tensor": "inception_v3/logits/predictions",
            "thresholds": [
                0.5,
                0.5
            ]
        }
    }]
}

List versions

Definition

Get the list of existing recognition versions.

# To access all your versions, use:
GET https://api.deepomatic.com/v0.7/recognition/versions

# To access versions attached to a given recognition spec, use:
GET https://api.deepomatic.com/v0.7/recognition/specs/{SPEC_ID}/versions

Code sample

# To access all your versions:
curl https://api.deepomatic.com/v0.7/recognition/versions \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

# To access versions attached to a given recognition spec, use:
curl https://api.deepomatic.com/v0.7/recognition/specs/42/versions \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

Response

A paginated list of responses.

JSON
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "spec_id": 42,
            "spec_name": "hot-dog VS not hot-dog classifier",
            "network_id": 123,
            "network_name": "hot-dog VS not hot-dog classifier",
            "update_date": "2018-03-09T18:30:43.404610Z"
        },
        ...
    ]
}

Retrieve a version

Definition

Retrieve a recognition version by ID.

cURL
GET https://api.deepomatic.com/v0.7/recognition/versions/{VERSION_ID}

Arguments

Code sample

curl https://api.deepomatic.com/v0.7/recognition/versions/1 \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

Response

A recognition version object.

Delete a version

Definition

Permanently deletes a recognition version.

cURL
DELETE https://api.deepomatic.com/v0.7/recognition/versions/{VERSION_ID}

This cannot be undone.

Arguments

Code sample

curl https://api.deepomatic.com/v0.7/recognition/versions/42 \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}" \
-X DELETE

Response

Return 204 (no content).

Version inference

Definition

Run inference on this specification version. This endpoint returns a task ID. Please refer to the Specification Inference to have a comprehensive list of the inference request arguments and response.

cURL
POST https://api.deepomatic.com/v0.7/recognition/versions/{VERSION_ID}/inference

Code sample

curl https://api.deepomatic.com/v0.7/recognition/versions/1/inference \
-X POST
-H "Content-Type: application/json" \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}" \
-d '{"inputs": [{"image": {"source": "https://static.deepomatic.com/resources/demos/api-clients/dog2.jpg"}}]}'

Response

A task JSON.

JSON
{
    "task_id": "123"
}

Last updated