Toybrick

标题: display boxes in inference result [打印本页]

作者: NG1368    时间: 2020-4-20 16:14
标题: display boxes in inference result
本帖最后由 NG1368 于 2020-4-20 16:16 编辑

hi, I am new in toybrick rk3399 board. in mobilenet test, I cant post process final result for display boxes in image. python3 test_inference.py output is:
[attach]996[/attach]
how can I display boxes As you wrote in the RKNN-Toolkit User Guide V1. 1.0.pdf?
[attach]995[/attach]


作者: jefferyzhang    时间: 2020-4-20 16:56
Which version of rknn-toolkit you used, there is a drawing code in latest (1.3.0) sample code as below:
  1. # Draw result
  2.     for i in range(0, vaildCnt):
  3.         if candidateBox[0][i] == -1:
  4.             continue

  5.         n = candidateBox[0][i]

  6.         xmin = max(0.0, min(1.0, predictions[0][n][1])) * INPUT_SIZE
  7.         ymin = max(0.0, min(1.0, predictions[0][n][0])) * INPUT_SIZE
  8.         xmax = max(0.0, min(1.0, predictions[0][n][3])) * INPUT_SIZE
  9.         ymax = max(0.0, min(1.0, predictions[0][n][2])) * INPUT_SIZE

  10.         # print("%d @ (%d, %d) (%d, %d) score=%f" % (topClassScoreIndex, xmin, ymin, xmax, ymax, topClassScore))
  11.         cv2.rectangle(orig_img, (int(xmin), int(ymin)), (int(xmax), int(ymax)),
  12.              (random.random()*255, random.random()*255, random.random()*255), 3)

  13.     cv2.imwrite("out.jpg", orig_img)
复制代码



作者: NG1368    时间: 2020-4-20 23:56
jefferyzhang 发表于 2020-4-20 16:56
Which version of rknn-toolkit you used, there is a drawing code in latest (1.3.0) sample code as bel ...

I use from1.2.1 version
作者: jefferyzhang    时间: 2020-4-21 08:32
NG1368 发表于 2020-4-20 23:56
I use from1.2.1 version

You have to download the latest rknn-toolkit from http://t.rock-chips.com/forum.ph ... &extra=page%3D1

And you will find the 1.3.0 has more samples there
作者: NG1368    时间: 2020-4-22 03:55
jefferyzhang 发表于 2020-4-21 08:32
You have to download the latest rknn-toolkit from http://t.rock-chips.com/forum.php?mod=viewthread ...

Where is it written that [156] indicates the dog's label ?
作者: NG1368    时间: 2020-4-22 04:00
jefferyzhang 发表于 2020-4-20 16:56
Which version of rknn-toolkit you used, there is a drawing code in latest (1.3.0) sample code as bel ...

I dont know how and where use  this code for display box.
作者: jefferyzhang    时间: 2020-4-22 08:43
In the 1.3.0 sample, coco_label_list.txt is the idx2name file.
You can use it to search the class name
作者: NG1368    时间: 2020-4-23 02:39
jefferyzhang 发表于 2020-4-20 16:56
Which version of rknn-toolkit you used, there is a drawing code in latest (1.3.0) sample code as bel ...

can you send me a link of example that use from this code for display boxes?
作者: NG1368    时间: 2020-4-23 02:53
NG1368 发表于 2020-4-23 02:39
can you send me a link of example that use from this code for display boxes?

I want to a complete example comprise of loading model, converting model to rknn and finally  drawing boxes in image for detect face ...
作者: jefferyzhang    时间: 2020-4-23 08:25
NG1368 发表于 2020-4-23 02:39
can you send me a link of example that use from this code for display boxes?

Try it:

https://rockchips-my.sharepoint. ... %2E3%2E0%2Fexamples
作者: NG1368    时间: 2020-4-23 13:23
jefferyzhang 发表于 2020-4-23 08:25
Try it:

https://rockchips-my.sharepoint.com/personal/addy_ke_rockchips_onmicrosoft_com/_layouts/1 ...

thanks... but for view this link, it is needed to Microsoft account. and when I log in with my Microsoft account, the following error occurs:
[attach]1007[/attach][attach]1007[/attach]

作者: NG1368    时间: 2020-4-23 13:27
jefferyzhang 发表于 2020-4-23 08:25
Try it:

https://rockchips-my.sharepoint.com/personal/addy_ke_rockchips_onmicrosoft_com/_layouts/1 ...

thanks, but for viewing this link, it is needed to log in with Microsoft account. when I log in with my Microsoft account, the following error occurs:
[attach]1006[/attach][attach]1006[/attach]

作者: NG1368    时间: 2020-4-23 13:40
jefferyzhang 发表于 2020-4-23 08:25
Try it:

https://rockchips-my.sharepoint.com/personal/addy_ke_rockchips_onmicrosoft_com/_layouts/1 ...

thanks, but I can't access it. when I log in with my Microsoft account, the following error occurs:[attach]1008[/attach]

作者: NG1368    时间: 2020-4-23 13:43
jefferyzhang 发表于 2020-4-23 08:25
Try it:

https://rockchips-my.sharepoint.com/personal/addy_ke_rockchips_onmicrosoft_com/_layouts/1 ...

thanks, but I can't access it. when I log in with my Microsoft account, the following error occurs:

作者: jefferyzhang    时间: 2020-4-23 15:25
https://rockchips-my.sharepoint. ... bWU9WHZsZEpWZm4xMGc


作者: NG1368    时间: 2020-4-24 03:48
jefferyzhang 发表于 2020-4-23 15:25
https://rockchips-my.sharepoint.com/personal/addy_ke_rockchips_onmicrosoft_com/_layouts/15/onedrive. ...

it didn't work and ended up in the same error.
作者: jefferyzhang    时间: 2020-4-24 08:27
NG1368 发表于 2020-4-24 03:48
it didn't work and ended up in the same error.

  Other people can work properly ...
Try this one:
https://github.com/rockchip-linux/rknn-toolkit




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3