jkjung-avt / tf_trt_models

TensorFlow object detection models accelerated with NVIDIA TensorRT (TF-TRT)
BSD 3-Clause "New" or "Revised" License
130 stars 51 forks source link

jetson nano inference #15

Open 8787878877 opened 3 years ago

8787878877 commented 3 years ago

Hello, I would like to ask, I use the detection.ipynb program to run on jetson nano. The model uses ssd_mobilenet_v1_coco for Transfer Learning. Before that, I have tested that the sample program can indeed run on nano, but use the model I trained to execute

figure = plt.figure()
ax = fig.add_subplot(1, 1, 1)

ax.imshow(image)

# plot boxes exceeding score threshold
for i in range(num_detections):
    # scale box to image coordinates
    box = boxes[i] * np.array([image.shape[0], image.shape[1], image.shape[0], image.shape[1]])

    # display rectangle
    patch = patches.Rectangle((box[1], box[0]), box[3]-box[1], box[2]-box[0], color='g', alpha=0.3)
    ax.add_patch(patch)

    # display class index and score
    plt.text(x=box[1] + 10, y=box[2]-10, s='%d (%0.2f) '% (classes[i], scores[i]), color='w ')

After plt.show() this code, the accuracy and the frame cannot be displayed. Is there any other way to solve it, thank you

jkjung-avt commented 3 years ago

Sorry I'm not able to help. I'm not familiar with such a use case of matplotlib.

8787878877 commented 3 years ago

I'm sorry, I want to ask, if the program isall right and the examples can run normally, will it be related to the trainingdata of the self in this case, or is it because of other problems, thank you

在 2021年5月18日 星期二 下午03:10:33 [GMT+8], JK ***@***.***> 寫道:  

Sorry I'm not able to help. I'm not familiar with such a use case of matplotlib.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jkjung-avt commented 3 years ago

I think you probably need to draw the bounding boxes with class id's and confidence scores before you call ax.imshow(). If you are not able to resolve that, find someone else to help you...

8787878877 commented 3 years ago

Okay thank you

在 2021年5月18日 星期二 下午05:52:37 [GMT+8], JK ***@***.***> 寫道:  

I think you probably need to draw the bounding boxes with class id's and confidence scores before you call ax.imshow(). If you are not able to resolve that, find someone else to help you...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.