Hi,
I have built & tuned successfully the mxnet gluoncv model, and the result (classIds, scores, boxes) of the model referenced is NDArray. I want to draw boxes of class Person only, so I need to select these results by the condition.
I got a big issue of performance with the tvm.runtime.ndarray.NDArray conversion. The conversion to numpy array always costs around 300ms.
> for i, cl in enumerate(scores.asnumpy()[0]):
> prop = cl[0]
> if prop < 0.5:
> continue
> cl_id = int(class_IDs.asnumpy()[0][i][0])
> if voc_classes[cl_id] != 'person':
> continue
> bbox = boxs.asnumpy()[0][i]
>
>
> cv2.rectangle(frame, (int(bbox[0]), int(bbox[1])), (int(bbox[2]), int(bbox[3])), 0, 3)
>
> temboxes.append(bbox)
> temscore.append(prop)
Is there any way or method that I can filter these results better?
Many thanks!!