Classify sample for the given set of variants
PreviousClassify sampleNextGet a window of raw sample features from cache, after a live classification job has completed.
Last updated
Last updated
Classify a complete file against the current impulse, for all given variants. Depending on the size of your file and whether the sample is resampled, you may get a job ID in the response.
Project ID
Sample ID
OK
const response = await fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/classify/v2/{sampleId}/variants?variants=%5B%22int8%22%2C+%22float32%22%5D', {
method: 'POST',
headers: {},
});
const data = await response.json();
{
"success": false,
"error": "text",
"results": [
{
"variant": "int8",
"classifications": [
{
"learnBlock": {
"id": 0,
"type": "anomaly",
"name": "NN Classifier",
"dsp": [
27
],
"title": "Classification (Keras)",
"description": "Reduced learning rate and more layers",
"createdBy": "createImpulse",
"createdAt": "2024-12-22T20:16:19.396Z"
},
"result": [
{
"idle": 0.0002,
"wave": 0.9998,
"anomaly": -0.42
}
],
"anomalyResult": [
{
"boxes": [
{
"label": "text",
"x": 0,
"y": 0,
"width": 0,
"height": 0,
"score": 0
}
],
"scores": [
[
0
]
],
"meanScore": 0,
"maxScore": 0
}
],
"structuredResult": [
{
"boxes": [
[
0
]
],
"labels": [
"text"
],
"scores": [
0
],
"mAP": 0,
"f1": 0,
"precision": 0,
"recall": 0,
"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": 0,
"details": [
{
"boxes": [
[
0
]
],
"labels": [
0
],
"scores": [
0
],
"mAP": 0,
"f1": 0
}
],
"objectDetectionLastLayer": "mobilenet-ssd",
"expectedLabels": [
{
"startIndex": 0,
"endIndex": 0,
"label": "text"
}
]
}
]
}
],
"sample": {
"sample": {
"id": 2,
"filename": "idle01.d8Ae",
"signatureValidate": true,
"signatureMethod": "HS256",
"signatureKey": "text",
"created": "2024-12-22T20:16:19.396Z",
"lastModified": "2024-12-22T20:16:19.396Z",
"category": "training",
"coldstorageFilename": "text",
"label": "healthy-machine",
"intervalMs": 16,
"frequency": 62.5,
"originalIntervalMs": 16,
"originalFrequency": 62.5,
"deviceName": "text",
"deviceType": "text",
"sensors": [
{
"name": "accX",
"units": "text"
}
],
"valuesCount": 0,
"totalLengthMs": 0,
"added": "2024-12-22T20:16:19.396Z",
"boundingBoxes": [
{
"label": "text",
"x": 0,
"y": 0,
"width": 0,
"height": 0
}
],
"boundingBoxesType": "object_detection",
"chartType": "chart",
"thumbnailVideo": "text",
"thumbnailVideoFull": "text",
"isDisabled": false,
"isProcessing": false,
"processingJobId": 0,
"processingError": false,
"processingErrorString": "text",
"isCropped": false,
"projectId": 0,
"projectOwnerName": "text",
"projectName": "text",
"projectLabelingMethod": "single_label",
"sha256Hash": "text",
"structuredLabels": [
{
"startIndex": 0,
"endIndex": 0,
"label": "text"
}
],
"structuredLabelsList": [
"text"
],
"createdBySyntheticDataJobId": 0,
"imageDimensions": {
"width": 0,
"height": 0
}
},
"payload": {
"device_name": "ac:87:a3:0a:2d:1b",
"device_type": "DISCO-L475VG-IOT01A",
"sensors": [
{
"name": "accX",
"units": "text"
}
],
"values": [
[
0
]
],
"cropStart": 0,
"cropEnd": 128
},
"totalPayloadLength": 0
},
"windowSizeMs": 2996,
"windowIncreaseMs": 10,
"alreadyInDatabase": false
}