norfair
norfair copied to clipboard
multiple norfair trackers
When trying to create multiple trackers eg:
# set up one tracker per camera
trackers: dict[str, Tracker] = {}
for _, rw in dict(config).items():
trackers[rw] = Tracker(
distance_function=euclidean_distance,
distance_threshold=max_distance_between_points,
hit_counter_max=hit_inertia_max,
past_detections_length=past_detections_length,
filter_factory=FilterPyKalmanFilterFactory(Q=Q),
)
the count is shared between all trackers due to the object manipulation in TrackedObject class. This looks like it may require a lot of changes to fix.
Please advise.
Hi @gilbo123 this is a known issue we are planning to include a fix to the shared count, however, we don't have encountered many cases where multiple trackers are needed.
So the official advice is to use a single instance of Tracker. A fix is coming but, for now, it is not a priority. Although this issue could change that if you have a compelling case for using multiple trackers
Hi Javier,
Thanks for the quick response! We have several cameras attached to our production computer (monitoring production quality) that detect objects and classify, track, and count them. As these cameras are independent (i.e. they monitor different production lines), we need each count to represent the number objects on that production line.
We have a multi-tracker developed by our team, but we were looking to upgrade and utilise the Kalman filter and memory advantages of Norfair.
Please let me know the expected timeframe as we may be able to allocate some hours to create a PR if needed.
regards
Dr Gilbert Eaton (PhD) 0416699516
On Sat, Sep 17, 2022 at 12:03 AM javier @.***> wrote:
Hi @gilbo123 https://github.com/gilbo123 this is a known issue we are planning to include a fix to the shared count, however, we don't have encountered many cases where multiple trackers are needed.
So the official advice is to use a single instance of Tracker. A fix is coming but, for now, it is not a priority. Although this issue could change that if you have a compelling case for using multiple trackers
— Reply to this email directly, view it on GitHub https://github.com/tryolabs/norfair/issues/181#issuecomment-1249404946, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJJM7RZLTIKEQDWBLEDK73V6R42VANCNFSM6AAAAAAQN4T2TI . You are receiving this because you were mentioned.Message ID: @.***>
That's a compelling argument haha.
Regarding the solution, I think the best solution (it's also the simplest) is not to reset TrackedObject.count when instantiating the tracker.
That'd mean that the count is global and sequential for all objects, regardless of the tracker that created them.
PR coming soon, we can keep the conversation about the effects of this change in there
Edit: just realize that this solution, although better than what we had, it doesn't solve your problem.
@gilbo123 you can ignore my previous comment where I didn't understand what you needed.
The fix needed is going to be more complex than a single line as I thought previously and since we are pushing towards a new release later this week, we are going to feature-freeze master for now.
However, this is going to be the first issue to tackle once the freeze is lifted.
Of course, if you want to start working on it before you're very much welcome! In that case, I recommend that we align on the strategy to solve this issue before starting to code it.
@gilbo123 we just merged a fix for this but it's not deployed on pypi yet.
so my recommendation now is to use the new property total_object_count on the tracker instance to get the count of objects seen by each tracker.
to use it you can install norfair directly from github with pip install git+https://github.com/tryolabs/norfair.git@master otherwise this will be available in the next release
Thanks for reporting this issue!
Hi Javier,
I have implemented the fix and confirmed it to be working as expected!
Amazing work from you and your team. Thankyou very much for your attention and quick response!
regards
Dr Gilbert Eaton (PhD) 0416699516
On Sat, Oct 1, 2022 at 5:36 AM javier @.***> wrote:
@gilbo123 https://github.com/gilbo123 we just merged a fix for this but it's not deployed on pypi yet.
so my recommendation now is to use the new property total_object_count on the tracker instance to get the count of objects seen by each tracker.
to use it you can install norfair directly from github with pip install @.*** otherwise this will be available in the next release
Thanks for reporting this issue!
— Reply to this email directly, view it on GitHub https://github.com/tryolabs/norfair/issues/181#issuecomment-1263945551, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJJM7QFIRGY3PAB6QZMZATWA46KNANCNFSM6AAAAAAQN4T2TI . You are receiving this because you were mentioned.Message ID: @.***>
Hi Javier,
I saw some conversations online RE GPU tracking and wondering if you plan on developing this?
We have between 4 and 9 trackers (thankyou for making this possible again) running simultaneously on a 4GPU inference machine with i9 12-core processor. The problem is the GPUs are idle most of the time while the CPU threads finish tracking. At the moment we need to speed up x 6 to achieve real time.
I understand that a single tracker can perform very well on an edge device for example - this is another future option for us.
Again, I was just wondering if you had any plans to develop, otherwise no problem.
Thanks for your help.
regards
Dr Gilbert Eaton (PhD) 0416699516
On Mon, Oct 3, 2022 at 9:05 AM Gilbert Eaton @.***> wrote:
Hi Javier,
I have implemented the fix and confirmed it to be working as expected!
Amazing work from you and your team. Thankyou very much for your attention and quick response!
regards
Dr Gilbert Eaton (PhD) 0416699516
On Sat, Oct 1, 2022 at 5:36 AM javier @.***> wrote:
@gilbo123 https://github.com/gilbo123 we just merged a fix for this but it's not deployed on pypi yet.
so my recommendation now is to use the new property total_object_count on the tracker instance to get the count of objects seen by each tracker.
to use it you can install norfair directly from github with pip install @.*** otherwise this will be available in the next release
Thanks for reporting this issue!
— Reply to this email directly, view it on GitHub https://github.com/tryolabs/norfair/issues/181#issuecomment-1263945551, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJJM7QFIRGY3PAB6QZMZATWA46KNANCNFSM6AAAAAAQN4T2TI . You are receiving this because you were mentioned.Message ID: @.***>
Hi @gilbo123, I understand that your use case is computationally expensive and it's hard to achieve real-time, but at the moment, we are not planning to develop any GPU tracking feature.
Thanks. Just thought I'd check.
Respectfully,
Dr Gilbert Eaton (PhD) +61416699516
On Wed, Mar 15, 2023 at 11:33 PM Facundo Lezama @.***> wrote:
Hi @gilbo123 https://github.com/gilbo123, I understand that your use case is computationally expensive and it's hard to achieve real-time, but at the moment, we are not planning to develop any GPU tracking feature.
— Reply to this email directly, view it on GitHub https://github.com/tryolabs/norfair/issues/181#issuecomment-1470019836, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJJM7XSOYZFLJS5DMZOR53W4HAJDANCNFSM6AAAAAAQN4T2TI . You are receiving this because you were mentioned.Message ID: @.***>