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

Fixed issue when object ID suddenly appears #181

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Conversation

Lihi-Gur-Arie
Copy link
Contributor

No description provided.

@cheind
Copy link
Owner

cheind commented Sep 21, 2023

hey, thanks for your contribution. could you explain which bug you address?

@Lihi-Gur-Arie
Copy link
Contributor Author

Sure!

When evaluating my tracker using py-motmetrics on a custom dataset, I encountered a KeyError on line 262 in mot.py:

abs(frameid - self.last_occurrence[o]) <= self.max_switch_time)
Upon investigation, I found that the error occurs when an object ID (o) that has not been seen in previous frames suddenly appears in the current frame. This is especially common in scenarios where objects are temporarily occluded or not detected in some frames and then reappear. The self.last_occurrence dictionary does not have an entry for such object IDs, leading to the KeyError.

I noticed that other users have faced a similar issue, as mentioned in this thread: #129.

My PR addresses this bug by ensuring that the object ID (o) exists in the self.last_occurrence dictionary before referencing it, thereby preventing the KeyError. This provides a more robust way of handling scenarios where object IDs might not appear continuously in every frame.

@cheind
Copy link
Owner

cheind commented Sep 22, 2023

@Lihi-Gur-Arie thanks for your explanation. Did you run the unit-tests?

@cheind cheind changed the title fixed a bug Fixed issue when object ID suddenly appears Sep 22, 2023
@cheind
Copy link
Owner

cheind commented Sep 22, 2023

I just added some fixes to the develop branch to make the unit-testing pipeline working again. would you mind rebasing your PR on the current state of develop and resubmit? then the above 3 checks should pass

@Lihi-Gur-Arie
Copy link
Contributor Author

Lihi-Gur-Arie commented Sep 25, 2023

@cheind
Sure, just merged it. Thanks!

@cheind
Copy link
Owner

cheind commented Sep 28, 2023

thanks - didn't notice that I had to manually trigger the CI.

@cheind cheind merged commit 22483cb into cheind:develop Sep 28, 2023
3 checks passed
@cheind
Copy link
Owner

cheind commented Sep 28, 2023

thanks again - merged into develop.

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

Successfully merging this pull request may close these issues.

2 participants