|
Which version of rknn-toolkit you used, there is a drawing code in latest (1.3.0) sample code as below:
- # Draw result
- for i in range(0, vaildCnt):
- if candidateBox[0][i] == -1:
- continue
- n = candidateBox[0][i]
- xmin = max(0.0, min(1.0, predictions[0][n][1])) * INPUT_SIZE
- ymin = max(0.0, min(1.0, predictions[0][n][0])) * INPUT_SIZE
- xmax = max(0.0, min(1.0, predictions[0][n][3])) * INPUT_SIZE
- ymax = max(0.0, min(1.0, predictions[0][n][2])) * INPUT_SIZE
- # print("%d @ (%d, %d) (%d, %d) score=%f" % (topClassScoreIndex, xmin, ymin, xmax, ymax, topClassScore))
- cv2.rectangle(orig_img, (int(xmin), int(ymin)), (int(xmax), int(ymax)),
- (random.random()*255, random.random()*255, random.random()*255), 3)
- cv2.imwrite("out.jpg", orig_img)
|
|