I tried to run Android app with SNPE 1.36 on SDM660 and Ubuntu18.04 .
When mobilenet_v2_ssd in SNPE detect something, I don't get the correct coordinates.
I have succeeded in passing the raw image.
The expected output coordinates should be those at the top left and bottom right of the rectangle,
but their relative positions are incorrect.
Are there need some setting?
run.sh
$SNPE_ROOT/examples/NativeCpp/SampleCode/obj/local/x86_64-linux-clang/snpe-sample \
-b ITENSOR -d ../model/mobilenet_iter_73000.dlc \
-i targetList/targetcrp300sq_raw_list.txt \
-o outputCrop
python viewraw.py output > output/output.txt
viewraw.py
#cording:utf-8
import sys
import numpy as np
import glob
import sys
if len(sys.argv)!=2:
print("not select folder")
sys.exit()
outpath=sys.argv[1]
labels=("background","person","bicycle","cyclist","car","motorcycle","raider","bus","truck","traffic_light","stop_sign","stop_line","crosswalk","bust_shot")
#labels=("person","bicycle","cyclist","car","motorcycle","raider","bus","truck","traffic_light","stop_sign","stop_line","crosswalk","bust_shot")
folders=glob.glob(outpath+"/Result_*")
for f in folders:
print(f)
res_cls=np.fromfile(f+'/Postprocessor/BatchMultiClassNonMaxSuppression_classes.raw',dtype="float32")
res_scr=np.fromfile(f+'/Postprocessor/BatchMultiClassNonMaxSuppression_scores.raw',dtype="float32")
res_box=np.fromfile(f+'/Postprocessor/BatchMultiClassNonMaxSuppression_boxes.raw',dtype="float32")
for item in range(len(res_cls)):
print(">>>>class:,{:2.0f},score,{:.2f},boxes[1920x1080]=(,{:4.0f},{:4.0f},),(,{:4.0f},{:4.0f},)".format(res_cls[item],res_scr[item]*100,res_box[item+0]*1920,res_box[item+1]*1080,res_box[item+2]*1920,res_box[item+3]*1080))
sys.exit()