for my final university exam I am trying to use SNPE with Tiny YOLO for real time object detection in an Android App. I succesfully converted model to DLC format, but i can't understand how to prepare input tensors and how to process output tensors. Can sameone help me? Thanks.
Steps to build SNPE neural network and get the output FloatTensor:
Create an asset folder in Android/app directory and keep the model file(.dlc) in the asset folder.
// assetFileName is the file name of .dlc
InputStream assetInputStream = application.getAssets().open(assetFileName); // Create and build the neural network
NeuralNetwork network = new SNPE.NeuralNetworkBuilder(application)
.setDebugEnabled(false)
//outputLayerNames can be got while converted model to DLC format
.setOutputLayers(outputLayerNames)
.setModel(assetInputStream, assetInputStream.available())
.setPerformanceProfile(NeuralNetwork.PerformanceProfile.DEFAULT)
.setRuntimeOrder(selectedRuntime) // Runtime.DSP, Runtime.GPU_FLOAT16, Runtime.GPU, Runtime.CPU
.setCpuFallbackEnabled(needsCpuFallback)
.build();
// Close input
assetInputStream.close();
Create an Input Tensor
Please follow the link below and find sections mentioned in steps 2,3 and 4 for preparing input Tensors and processing output tensors https://developer.qualcomm.com/docs/snpe/android_tutorial.html