norfair icon indicating copy to clipboard operation
norfair copied to clipboard

Do not store past detections by default.

Open facundo-lezama opened this issue 3 years ago • 2 comments
trafficstars

Until now, the default value for past_detections_length was 4. This meant that even if you don't use the past detections in your workflow, Norfair is still storing them, making unnecessary operations and potentially using a great amount of memory for storing embeddings or image crops.

We now set the default value of past_detections_length to 0. If the user wants to use the TrackedObject's past detections when matching, it must be specified when initiating the Tracker instance.

facundo-lezama avatar Oct 17 '22 19:10 facundo-lezama

Is there an easy way to warn the user if they access past_detections but past_detections_length is set to 0?

javiber avatar Oct 18 '22 13:10 javiber

Is there an easy way to warn the user if they access past_detections but past_detections_length is set to 0?

We may change past_detections to become a property and handle the warning when it is accessed. But giving it another thought and knowing that computational performance isn't a big deal when using past_detections_length>0, we may set the default value to 1 instead and avoid confusion to the user. Also, setting the default to 1 isn't going to increase the memory that much.

What are your thoughts @javiber?

facundo-lezama avatar Oct 18 '22 14:10 facundo-lezama