Is it possible to convert a yolov3-tiny model to TensorRT?

Working on a object detection system to run on the Nano+RP2 camera (or a Pi+RP2 camera+Coral board) and trying to figure out how to get an FPS >= 20.

Thus far, we’ve build a yolov3-tiny model that works very well for our purposes. BUT, with the latest opencv (4.2), we’re only able to get ~ 8 FPS on the Nano. That is a huge improvement from before (which was ~ 2FPS) but we need to do better to make this usuable.

So …

  1. Is it possible to convert yolov3-tiny to Tensor RT? If so, how? And, how to use it with opencv 4.2?

  2. Is there something better we should be looking at besides YOLO? We are most comfortable with PyTorch … so if there is, it would be greatly appreciated to know what it is, what what the best approaches might be for training and inference.

Thanks much! - wg

Hi,

1. YES. We also have a sample for it.
It’s recommended to use our latest JetPack4.3 with Deepstream 4.0.2.
And the sample is located at /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_Yolo/.

A acceleration patch can be found here. We can reach 20FPS with yoloV3 model (not tiny version).

2. You can train a model with pyTorch and convert it into TensorRT also.
For Nano, it’s recommended to use TensorRT as inference engine to get the best performance.

Thanks.

Thanks for the reply … a few follow-up questions (new to CV on iot devices in particular so pardon my ignorance):

“A acceleration patch can be found here. We can reach 20FPS with yoloV3 model (not tiny version).”

What is an “accelerator patch”?

And would I be right in assuming the yolov3-tiny model would get even better results?

“You can train a model with pyTorch and convert it into TensorRT also.”

Are the docs/tutorials on how to do this … for both PyTorch and Yolo?

Hi,

Sorry for the late update.

1.
The patch link will redirect you to a previous comment.
In the comment, it show you how to update the source to have a better performance.
Please noticed that it decrease the network input size and inference period which might lead to slightly lower accuracy.

2.
As you may know, YOLO is developed with Darknet frameworks.
To retrain YOLO with pyTorch, you can use community resource:

For example: https://github.com/eriklindernoren/PyTorch-YOLOv3

Thanks.