Forums - can't get the correct coordinates

1 post / 0 new
can't get the correct coordinates
masataka.mifune.rs
Join Date: 16 Mar 21
Posts: 1
Posted: Mon, 2021-07-19 23:24
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()
 
  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.