Toybrick

display boxes in inference result

NG1368

注册会员

积分
52
楼主
发表于 2020-4-20 16:14:41    查看: 21298|回复: 16 | [复制链接]    打印 | 只看该作者
本帖最后由 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:

how can I display boxes As you wrote in the RKNN-Toolkit User Guide V1. 1.0.pdf?


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

jefferyzhang

版主

积分
12952
沙发
发表于 2020-4-20 16:56:32 | 只看该作者
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

注册会员

积分
52
板凳
 楼主| 发表于 2020-4-20 23:56:40 | 只看该作者
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

版主

积分
12952
地板
发表于 2020-4-21 08:32:35 | 只看该作者
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

注册会员

积分
52
5#
 楼主| 发表于 2020-4-22 03:55:52 | 只看该作者
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

注册会员

积分
52
6#
 楼主| 发表于 2020-4-22 04:00:34 | 只看该作者
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

版主

积分
12952
7#
发表于 2020-4-22 08:43:33 | 只看该作者
In the 1.3.0 sample, coco_label_list.txt is the idx2name file.
You can use it to search the class name
回复

使用道具 举报

NG1368

注册会员

积分
52
8#
 楼主| 发表于 2020-4-23 02:39:19 | 只看该作者
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

注册会员

积分
52
9#
 楼主| 发表于 2020-4-23 02:53:12 | 只看该作者
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

版主

积分
12952
10#
发表于 2020-4-23 08:25:40 | 只看该作者
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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表