-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When adding trackers, the result lags " TPEs + 1" frames #9
Comments
Maybe you reference the same mat object in the main thread and sub-thread, just like this demo code, the second.jpg and third.jpg pictures are actually the same object
Make sure that the mat(frame) object referenced every time is brand new, for example, reading the camera in a loop |
@leafqycc , thanks for your reply!!! I have solved above problem. I would like to ask about the problem of using multi-threading to detect two videos at the same time by using your method. When I add two videos(example video 1 and video2), in the final detection results, some frames of video 1 appear in the results of video2 and the frames of video2 appear in the results of video1. I don't know why this situation occurs. Could you help me? Here is my multithreads code: path_video1 = '/home/rpdzkj/Yolov7-Deepsort-rknn111/16.00.00.mp4' tracker_thread1 = threading.Thread(target=run_tracker_in_thread, args=(path_video1, pool, TPEs, 1), daemon=True) tracker_thread1.start() tracker_thread1.join() and the method run_tracker_in_thread is : `def run_tracker_in_thread(filename, pool, TPEs, file_index):
|
You need to initialize different rknnPoolExecutor objects for two threads, and in the above code tracker_thread1 and tracker_thread2 call the same pool for object detection, because the pool get operation is carried out concurrently, resulting in the order of image acquisition is confused, and some frames of video 1 appear in the results of video2 and the frames of video2 appear in the results of video1. |
@leafqycc , thank you very much. I have solved the problem by initializing different rknnPoolExecutor objects. |
hi @leafqycc , do you try to add trackers like DeepSort? when I infer my model yolov6 + DeepSort, the final result will lag " TPEs + 1" frames. I print the detetction result and tracking results, then I find the detection result of "TPEs + 2" frame is same as the first frame. This leads to the final error. But I don' t know how to solve it.
The text was updated successfully, but these errors were encountered: