curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/classify/v2/{sampleId} \
--header 'x-api-key: <api-key>'
{
"success": true,
"error": "<string>",
"classifications": [
{
"learnBlock": {
"id": 2,
"type": "anomaly",
"name": "NN Classifier",
"dsp": [
27
],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
},
"result": [
{
"idle": 0.0002,
"wave": 0.9998,
"anomaly": -0.42
}
],
"anomalyResult": [
{
"boxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"score": 123
}
],
"scores": [
[
123
]
],
"meanScore": 123,
"maxScore": 123
}
],
"structuredResult": [
{
"boxes": [
[
123
]
],
"labels": [
"<string>"
],
"scores": [
123
],
"mAP": 123,
"f1": 123,
"precision": 123,
"recall": 123,
"debugInfoJson": "{\n \"y_trues\": [\n {\"x\": 0.854, \"y\": 0.453125, \"label\": 1},\n {\"x\": 0.197, \"y\": 0.53125, \"label\": 2}\n ],\n \"y_preds\": [\n {\"x\": 0.916, \"y\": 0.875, \"label\": 1},\n {\"x\": 0.25, \"y\": 0.541, \"label\": 2}\n ],\n \"assignments\": [\n {\"yp\": 1, \"yt\": 1, \"label\": 2, \"distance\": 0.053}\n ],\n \"normalised_min_distance\": 0.2,\n \"all_pairwise_distances\": [\n [0, 0, 0.426],\n [1, 1, 0.053]\n ],\n \"unassigned_y_true_idxs\": [0],\n \"unassigned_y_pred_idxs\": [0]\n}\n"
}
],
"minimumConfidenceRating": 123,
"details": [
{
"boxes": [
[
123
]
],
"labels": [
123
],
"scores": [
123
],
"mAP": 123,
"f1": 123
}
],
"objectDetectionLastLayer": "mobilenet-ssd",
"expectedLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>"
}
],
"thresholds": [
{
"key": "min_score",
"description": "Score threshold",
"helpText": "Threshold score for bounding boxes. If the score for a bounding box is below this the box will be discarded.",
"suggestedValue": 123,
"suggestedValueText": "<string>",
"value": 0.5
}
]
}
],
"sample": {
"sample": {
"id": 2,
"filename": "idle01.d8Ae",
"signatureValidate": true,
"signatureMethod": "HS256",
"signatureKey": "<string>",
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"category": "training",
"coldstorageFilename": "<string>",
"label": "healthy-machine",
"intervalMs": 16,
"frequency": 62.5,
"originalIntervalMs": 16,
"originalFrequency": 62.5,
"deviceName": "<string>",
"deviceType": "<string>",
"sensors": [
{
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"totalLengthMs": 123,
"added": "2023-11-07T05:31:56Z",
"boundingBoxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"boundingBoxesType": "object_detection",
"chartType": "chart",
"thumbnailVideo": "<string>",
"thumbnailVideoFull": "<string>",
"isDisabled": true,
"isProcessing": true,
"processingJobId": 123,
"processingError": true,
"processingErrorString": "<string>",
"isCropped": true,
"metadata": {},
"projectId": 123,
"projectOwnerName": "<string>",
"projectName": "<string>",
"projectLabelingMethod": "single_label",
"sha256Hash": "<string>",
"structuredLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>"
}
],
"structuredLabelsList": [
"<string>"
],
"createdBySyntheticDataJobId": 123,
"imageDimensions": {
"width": 123,
"height": 123
},
"videoUrl": "<string>",
"videoUrlFull": "<string>"
},
"payload": {
"device_name": "ac:87:a3:0a:2d:1b",
"device_type": "DISCO-L475VG-IOT01A",
"sensors": [
{
"name": "accX",
"units": "<string>"
}
],
"values": [
[
123
]
],
"cropStart": 0,
"cropEnd": 128
},
"totalPayloadLength": 123
},
"windowSizeMs": 2996,
"windowIncreaseMs": 10,
"alreadyInDatabase": true,
"warning": "<string>"
}
Classify a complete file against the current impulse. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and classify for every window that is extracted. Depending on the size of your file, whether your sample is resampled, and whether the result is cached you’ll get either the result or a job back. If you receive a job, then wait for the completion of the job, and then call this function again to receive the results. The unoptimized (float32) model is used by default, and classification with an optimized (int8) model can be slower.
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/classify/v2/{sampleId} \
--header 'x-api-key: <api-key>'
{
"success": true,
"error": "<string>",
"classifications": [
{
"learnBlock": {
"id": 2,
"type": "anomaly",
"name": "NN Classifier",
"dsp": [
27
],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
},
"result": [
{
"idle": 0.0002,
"wave": 0.9998,
"anomaly": -0.42
}
],
"anomalyResult": [
{
"boxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123,
"score": 123
}
],
"scores": [
[
123
]
],
"meanScore": 123,
"maxScore": 123
}
],
"structuredResult": [
{
"boxes": [
[
123
]
],
"labels": [
"<string>"
],
"scores": [
123
],
"mAP": 123,
"f1": 123,
"precision": 123,
"recall": 123,
"debugInfoJson": "{\n \"y_trues\": [\n {\"x\": 0.854, \"y\": 0.453125, \"label\": 1},\n {\"x\": 0.197, \"y\": 0.53125, \"label\": 2}\n ],\n \"y_preds\": [\n {\"x\": 0.916, \"y\": 0.875, \"label\": 1},\n {\"x\": 0.25, \"y\": 0.541, \"label\": 2}\n ],\n \"assignments\": [\n {\"yp\": 1, \"yt\": 1, \"label\": 2, \"distance\": 0.053}\n ],\n \"normalised_min_distance\": 0.2,\n \"all_pairwise_distances\": [\n [0, 0, 0.426],\n [1, 1, 0.053]\n ],\n \"unassigned_y_true_idxs\": [0],\n \"unassigned_y_pred_idxs\": [0]\n}\n"
}
],
"minimumConfidenceRating": 123,
"details": [
{
"boxes": [
[
123
]
],
"labels": [
123
],
"scores": [
123
],
"mAP": 123,
"f1": 123
}
],
"objectDetectionLastLayer": "mobilenet-ssd",
"expectedLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>"
}
],
"thresholds": [
{
"key": "min_score",
"description": "Score threshold",
"helpText": "Threshold score for bounding boxes. If the score for a bounding box is below this the box will be discarded.",
"suggestedValue": 123,
"suggestedValueText": "<string>",
"value": 0.5
}
]
}
],
"sample": {
"sample": {
"id": 2,
"filename": "idle01.d8Ae",
"signatureValidate": true,
"signatureMethod": "HS256",
"signatureKey": "<string>",
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"category": "training",
"coldstorageFilename": "<string>",
"label": "healthy-machine",
"intervalMs": 16,
"frequency": 62.5,
"originalIntervalMs": 16,
"originalFrequency": 62.5,
"deviceName": "<string>",
"deviceType": "<string>",
"sensors": [
{
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"totalLengthMs": 123,
"added": "2023-11-07T05:31:56Z",
"boundingBoxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"boundingBoxesType": "object_detection",
"chartType": "chart",
"thumbnailVideo": "<string>",
"thumbnailVideoFull": "<string>",
"isDisabled": true,
"isProcessing": true,
"processingJobId": 123,
"processingError": true,
"processingErrorString": "<string>",
"isCropped": true,
"metadata": {},
"projectId": 123,
"projectOwnerName": "<string>",
"projectName": "<string>",
"projectLabelingMethod": "single_label",
"sha256Hash": "<string>",
"structuredLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>"
}
],
"structuredLabelsList": [
"<string>"
],
"createdBySyntheticDataJobId": 123,
"imageDimensions": {
"width": 123,
"height": 123
},
"videoUrl": "<string>",
"videoUrlFull": "<string>"
},
"payload": {
"device_name": "ac:87:a3:0a:2d:1b",
"device_type": "DISCO-L475VG-IOT01A",
"sensors": [
{
"name": "accX",
"units": "<string>"
}
],
"values": [
[
123
]
],
"cropStart": 0,
"cropEnd": 128
},
"totalPayloadLength": 123
},
"windowSizeMs": 2996,
"windowIncreaseMs": 10,
"alreadyInDatabase": true,
"warning": "<string>"
}
Whether to return the debug information from FOMO classification.
Keras model variant
int8
, float32
, akida
Impulse ID. If this is unset then the default impulse is used.
If true, only a slice of labels will be returned for samples with multiple labels.
OK
The response is of type object
.