-
Hi all, Thank you for building this amazing library! I’ve been exploring it for the past few days and am new to object tracking.
I’d appreciate any insights to help me develop better intuition for working with such scenarios. ref: https://supervision.roboflow.com/develop/notebooks/count-objects-crossing-the-line/ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @acode-x 👋 Thank you for a thorough question!
You may need from time import time
`time_now = time()
# by class ID
detections = detections[detections.class_id == 0]
# by class name
detections = datections[detections["class_name" == "car"]] |
Beta Was this translation helpful? Give feedback.
-
Thank a lot for this detailed explanation. I am now able to implement both the use cases! |
Beta Was this translation helpful? Give feedback.
Hi @acode-x 👋
Thank you for a thorough question!
sv.ByteTrack
), and record the position of each detection, as well as the time it was first detected or moved:dict[tracker_id, [detection_center, stationary_since]]
. Check the time when the program started. Then every time you update, if the detection moved by X or more, reset the time. If it didn't move, update the values. This way, you'll know how long each object stood for.You may need
sv.DetectionsSmoother
, to play around with ByteTrack settings, or to create a custom filtering implementation that avoids jittering or missing detections.