Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Android : Object tracking and video playback #789

Open
lmartin opened this issue Mar 8, 2024 · 6 comments
Open

[Bug report] Android : Object tracking and video playback #789

lmartin opened this issue Mar 8, 2024 · 6 comments
Assignees

Comments

@lmartin
Copy link

lmartin commented Mar 8, 2024

I'm trying to use object tracking for video playback use case, but after some tests it looks like that object tracking is only designed for live video, correct?

It looks like there is a kind of latency threshold between 2 tracking frames, beyond this threshold tracker failed to find any objects.

I found this project https://github.com/ZeroOneZeroR/android-ml-kit-vision-with-video but is does not use object tracking with video playback.

Is there a way to configure the tracker to accept any latency between 2 frames?

@ai-plays
Copy link
Collaborator

Your observation is right. There is some internal threshold that if two frames are too far apart in time, we don't try to apply the tracker algorithm between them (because things may change more dramatically that the tracker will not work well).

Are you using live video feed or processing an already recored video? Could you tell us more why you need to increase the threshold? Because you are running on some very low end devices that is very slow?

@ai-plays ai-plays self-assigned this Mar 18, 2024
@lmartin
Copy link
Author

lmartin commented Mar 19, 2024

I'm using video playback of an already recorded video. My app is a video editor. I want to track objects on frames each second.

To do this : I pause the video, process the frame, seek 1 second later, and so on... but video seeking can be long (depending on device and video input) and furthermore I use Bitmap API in my case (which is even longer).

Having the possibility to set the threshold value would be great.

@ai-plays
Copy link
Collaborator

If the frame interval is 1 second, the position of the same object in the two frames could be very different. In such case the tracker algorithm may not work well even if you adjust the threshold.

If you really want to do it, there is a workaround you could try: preprocess the frames in advance to get the sequence of frames you want to run object detection and tracking on, then just pass them one by one to the detector without seeking in between.

@lmartin
Copy link
Author

lmartin commented Mar 21, 2024

Another workaround that would fit the tracker algorithm would be to preprocess all the frames in 1 second interval and then pass them to the detector, I could repeat this sequence on all the video length but it will need to disable the threshold to prevent failing between 2 sequences.

@lmartin
Copy link
Author

lmartin commented Mar 26, 2024

Would it possible to expose the threshold as an editable property?

@ai-plays
Copy link
Collaborator

Hi lmartin,

There is no release plan for this feature in the near future, for this specific request.

I would suggest to go with some workaround with what is available at the moment.

Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@lmartin @ai-plays and others