Scailable.
Search…
⌃K

Edge AI Manager JSON Tensor Format

This page describes the structure of input and output JSON messages

Input examples

The available inputType : json, raw, and pb.
The available inputFormat and outputFormat : namedObject, and orderedArray.
Single JSON input tensor:
{
"input": [0.000593897, 0.000020396, 0.036555252, 0.009653889, 0.000281286, 0.952525370, 0.000369997],
"inputType": "json"
}
Two JSON input tensors in the default orderedArray format. Tensor arrays need to be in the order the tensors are defined in the ONNX graph.
{
"input": [
[0.000123895, 0.000025326],
[0.036555252, 0.009653889, 0.000281286]
],
"inputType": "json"
}
The same as the previous example, now with the orderedArray format defined explicitly:
{
"input": [
[0.000123895, 0.000025326],
[0.036555252, 0.009653889, 0.000281286]
],
"inputType": "json",
"format": "orderedArray",
"outputFormat": "orderedArray"
}
Two JSON input tensors in the namedObject format: An object with named fields representing the input names as defined in the original ONNX. The order of the input named fields does not matter for the namedObject format type.
{
"input": {
"input-tensor-one-name": [0.000123895, 0.000025326],
"input-tensor-two-name": [0.036555252, 0.009653889, 0.000281286]
},
"inputType": "json",
"inputFormat": "namedObject",
"outputFormat": "namedObject"
}
Single Base64 encoded byte array input tensor:
{"input": "MjQzNDQ0NTY0NTM0MzI=", "inputType": "raw"}
Three Base64 encoded byte array input tensors:
{"input": ["MjQzNDQ0NTY0NTM0MzI=","MTExMjMzMjE=","OTIzMzQ1NDM0MzU="], "inputType": "raw"}
Three Base64 encoded byte array input tensors, now in the namedObject format:
{
"input": {
"input3": "OTIzMzQ1NDM0MzU",
"input1": "MjQzNDQ0NTY0NTM0MzI=",
"input2": "MTExMjMzMjE="
},
"inputType": "raw",
"inputFormat": "namedObject",
"outputFormat": "orderedArray"
}
Two Base64 encoded ProtoBuf input tensors:
{"input": ["c2Rmc2Zkc2Zkc2FmZHNhZndyM3FmYWZld2Zm","mZHNhZndyM3FmYWZld2ZmM0MjM0MmFmd2FlMzQ="], "inputType": "pb"}

Output examples

outputType : json, and raw,
outputFormat : namedObject, and orderedArray.
outputDims represents each if the output tensors dimensions.
outputDataTypes values represents the data type of each tensor according to the following overview:
1 = FLOAT32 (FLOAT)
2 = UINT8
3 = INT8
4 = UINT16
5 = INT16
6 = INT32
7 = INT64
9 = BOOL
11 = FLOAT64 (DOUBLE)
12 = UINT32
13 = UINT64
Single JSON output tensor
{
"outputDims": [
[
[7]
]
],
"outputDataTypes": [
1
],
"outputType": "json",
"outputFormat": "orderedArray",
"output": [0.000593897, 0.000020396, 0.036555252, 0.009653889, 0.000281286, 0.952525370, 0.000369997]
}
Two JSON output tensors
{
"outputDims": [
[
[2],
[3]
]
],
"outputDataTypes": [
1, 1
],
"outputType": "json",
"outputFormat": "orderedArray",
"output": [
[0.000123895, 0.000025326],
[0.036555252, 0.009653889, 0.000281286]
]
}
Single Base64 encoded byte array output tensor
{
"outputDims": [
[
[7]
],
],
"outputDataTypes": [
1
],
"outputType": "raw",
"outputFormat": "orderedArray",
"output": "MjQzNDQ0NTY0NTM0MzI="
}
Three Base64 encoded byte array output tensors
{
"outputDims": [
[2],
[3],
[2]
],
"outputDataTypes": [1, 1, 7],
"outputType": "raw",
"outputFormat": "orderedArray",
"output": ["MjQzNDQ0NTY0NTM0MzI=", "MTExMjMzMjE=", "OTIzMzQ1NDM0MzU="]
}
Three Base64 encoded byte array input tensors, now in the namedObjectformat:
{
"outputDims": [
[2],
[3],
[2]
],
"outputDataTypes": [1, 1, 7],
"outputType": "raw",
"outputFormat": "namedObject",
"output": {
"output1": "MjQzNDQ0NTY0NTM0MzI",
"output2": "MTExMjMzMjE=",
"output3": "OTIzMzQ1NDM0MzU="
}
}