Skip to content

Managing Objects across frames #1635

Closed Answered by LinasKo
acode-x asked this question in Q&A
Oct 30, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @acode-x 👋

Thank you for a thorough question!

  1. You'll have to apply an object tracker (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.

from time import time
`time_now = time()
  1. When you get the…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@onuralpszr
Comment options

Answer selected by acode-x
Comment options

You must be logged in to vote
1 reply
@LinasKo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants