I am using ROS Melodic, Tensorflow 2.x, and YOLOv4
My current tracking implementation is slowed down by object detection as it always has to wait for my model to detect the object first, which takes some time, losing a few frames. Hence, I want to increase the FPS by only having to run the YOLO detection every few frames while continuously running the object tracking every single frame.
My current implementation works like this:
1) I have a subscriber node to an Image topic. The callback function will be called every time an Image is received. This callback function converts the image type and saves it globally.
2) In the main code, I have a while loop where it constantly uses the current global converted image to perform object detection, followed by the tracking
Do I have to do some form of multithreading or multiprocessing? How should I go about doing this?
I am using ROS Melodic, Tensorflow 2.x, and YOLOv4
My current tracking implementation is slowed down by object detection as it always has to wait for my model to detect the object first, which takes some time, losing a few frames. Hence, I want to increase the FPS by only having to run the YOLO detection every few frames while continuously running the object tracking every single frame.
My current implementation works like this: 1) I have a subscriber node to an Image topic. The callback function will be called every time an Image is received. This callback function converts the image type and saves it globally. 2) In the main code, I have a while loop where it constantly uses the current global converted image to perform object detection, followed by the tracking
Do I have to do some form of multithreading or multiprocessing? How should I go about doing this?
EDIT Found a solution by looking at #167