HI,
Given code at /snpe-1.2.2/examples/android/image-classifiers was modifed to work for tensor flow model inception_v3.
Following are the three changes done in ClassifyImageTask.java to make it work for tensorflow model
1. while createFloatTensor
final FloatTensor tensor = mNeuralNetwork.createFloatTensor( mNeuralNetwork.getInputTensorsShapes().get("Mul:0"));
2. while creating input to execute
inputs.put("Mul:0", tensor);
3. chaged string OUTPUT_LAYER
public static final String OUTPUT_LAYER = "softmax:0";
The script file setup_models.sh was also modified to copy from correct location:
cp -R ../../../../models/inception_v3/data/cropped/*.jpg images cp -R ../../../../models/inception_v3/dlc/inception_v3_quantized.dlc model.dlc cp -R ../../../../models/inception_v3/data/imagenet_comp_graph_label_strings.txt labels.txt
Mean image bin file was not created so it was not included in the script.
After doing all above changes the app is classifying images incorrectly. The label index generated from topK() function are not matching with the labels.txt. Please let me know if anything is wrong with my procedure
Please help solve the above mentioned problem
Facing the same issue here, will appreciate for any help on this.
I am facing the same issue now. I should appreciate it if you could reply as soon as possible.
met the same issue for snpe 1.6.0
You are likely missing image pre-processing such as mean subraction ?
"You are likely missing image pre-processing such as mean subraction ?"
As per the documentation "input_preprocessing.html"
-->These image preprocessing operations are currently only supported for DLC networks converted from a Caffe model.
Plese let me know how the same can be acheived for tensorflow model.
One more Observation:
If we follow the documentation "tutorial_inceptionv3.html" for Running on Android topic, we get correct image classification!!.....It gives wrong classification only when running via android studio using java apis. Is there something wrong with java apis or some more process has to be follwed when running via android studio.
Inception v3 requires the inputs to be preprocessed so you must either generate a mean image file (which the sample will handle) or write code to do preprocessing in the application.
You can find preprocessing for inception v3 as a reference in the <SDK-ROOT>/models/inception_v3/scripts/create_inceptionv3_raws.py
Cheers,
I am following the sample provided in the SDK. I have run the command
python ./models/inception_v3/scripts/setup_inceptionv3.py -a ./temp-assets-cache -d
where preprocessing is being done already.
But mean Image file "ilsvrc_2012_mean_cropped.bin" is not generated as it happens in alexnet. Is this the problem because this file is being used in ClassifyImageTask.java in method loadMeanImageIfAvailable().
Please help fixing the issue.
Thanks,
I meet the same issue
You can not use the alexnet scripts for inception v3.
Before you send an image buffer to SNPE you must preprocess according to the network requirements. Look for inception v3 preprocessing requirements and either create a mean binary image or change the sample code to do it in the application before sending to SNPE.
please provide some reference or document for creating mean binary image for inception_v3
Hi. The inceptionv3 example shows how to create raw images for inception V3.
$SNPE_ROOT/models/inception_v3/scripts/create_inceptionv3_raws.py
Hi,
As I have already mentioned, I am using script setup_inceptionv3.py. This script already uses create_inceptionv3_raws.py internally. This script does not work!!
Try modifying the method writeRgbBitmapAsFloat in java/com/qualcomm/qti/snpe/imageclassifiers/tasks/ClassifyImageTask.java
There do the preprocessing for inception v3 on every RGB element of the image before forward propagating. Change the sample so it doesnt use the mean image file and do the preprocessing in place.
Can you post exactly what preprocessing you intend to use on each RGB element so we double check?
Thanks,
Found the answer at
https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-neur...
Thanks
Found the answer at
https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-neur...
Thanks