I am trying to process the output of the tflite model in swift. The output tensor shape is Shape(rank: 3, dimensions: [1, 25200, 6]). So how can I extract the information out of it which is of return type Data in Swift? This is the code so far
func runInference() {
Task {
do {
let interpreter = try Interpreter(modelPath: modelPath)
try interpreter.allocateTensors()
do {
if preprocessedImg != nil {
try interpreter.copy(preprocessedImg!, toInputAt: 0)
try interpreter.invoke()
let outputTensor = try interpreter.output(at: 0)
let outputData = outputTensor.data
}
} catch let error {
print("Error: \(error)")
}
} catch let error {
print("Error: \(error)")
}
}
}