hukkelas / deep_privacy2

DeepPrivacy2 - A Toolbox for Realistic Image Anonymization
Apache License 2.0
292 stars 33 forks source link

'MultiObjectTracker' object has no attribute 'detections_matched_ids' #18

Closed deepak046 closed 8 months ago

deepak046 commented 1 year ago

When I try to use --track flag to run anonymize.py I get the error saying that the object of MultiObjectTracker class doesn't have the attribute named 'detections_matched_ids'. From the motpy pypi package I installed, I checked the class definition for MultiObjectTracker class and it doesn't seem to have this attribute in it. The attribute 'detections_matched_ids' is referred in forward() function of Anonymizer class to retrieve the track_ids. But the attribute seems to be absent everywhere in the class definition of MultiObjectTracker class.

Whereas, I checked this script (https://github.com/wmuron/motpy/blob/master/motpy/tracker.py) from the motpy repository and they seem to have it defined as an attribute.

My question: Was the attribute 'detections_matched_ids' intentionally removed in this project repository? I feel it could be a mistake since you try to use the track_ids in Anonymizer class. Let me know if I'm missing out something! Thanks!

deepak046 commented 1 year ago

EDIT: I added the lines 361, 404, 410 and 420 from this script (https://github.com/wmuron/motpy/blob/master/motpy/tracker.py) to the same tracker.py file in the motpy pypi package that's used by deep_privacy2 repo, and the anonymize.py scripts runs now with --track flag!

This is how I solved the problem (for someone who could potentially face the same issue)

hukkelas commented 1 year ago

Motpy changed this at some point, and installing motpy with the  setup.py file provided in this repository should fix your issue. Or you could simply install it with pip

pip install git+https://github.com/wmuron/motpy@c77f85d27e371c0a298e9a88ca99292d9b9cbe6b