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

Rewrite noise filter of visualization logic #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arkincognito
Copy link

@arkincognito arkincognito commented Oct 4, 2021

I thought the original code if np.unique(predictions[-10:])[0]==np.argmax(res): was a filter: that would allow probability evaluation if the current frame is classified as the most frequent class of the past 10 frames. However, as I read more closely, I found out that the code will check if the class index of the current frame is the smallest class index of the classifications of the past 10 frames. In the case of your video, this if statement will always see if current frame's class is 'hello' if any one of the past ten frames were classified as 'hello'(since your action classes are ['hello', 'thanks', 'iloveyou']).

By using np.bincount, the if statement now evaluates the current frame's class with the most frequent class of the past ten frames. np.bincount has its takeaway as the total class number increases, so does the memory size.

If I have misunderstood your intention in the if statement, please let me know.

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.

1 participant