nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.3k stars 1.48k forks source link

Can I track every frame but perform object detection only after every few frames? #269

Closed dylantzx closed 3 years ago

dylantzx commented 3 years ago

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

fedi112 commented 2 years ago

Hello can you tell us exactly what did you change ?