jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.75k stars 547 forks source link

working with two cameras #496

Closed oboyraz closed 2 years ago

oboyraz commented 3 years ago

Hi, What would you recommend for running tensorrt with two cameras? How can it be integrated into coding?

jkjung-avt commented 3 years ago

What would you recommend for running tensorrt with two cameras? How can it be integrated into coding?

It depends on your application. One simple way is to run 2 separate processes, with each one opening its own camera instance and inferencing with its own TensorRT runtime. Camera frames would not be synced in this case, since the 2 processes run independently.

Another way is to create 2 threads in the program and to capture image frames from the 2 cameras separately. Please refer to https://github.com/jkjung-avt/tensorrt_demos/issues/329. If you want to synchronize image frames from the 2 cameras, you'll have to implement additional code to do that.

Yet another alternative would be to use NVIDIA DeepStream SDK.