norfair
norfair copied to clipboard
Do not store past detections by default.
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.
Is there an easy way to warn the user if they access past_detections but past_detections_length is set to 0?
Is there an easy way to warn the user if they access
past_detectionsbutpast_detections_lengthis 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?