-
Notifications
You must be signed in to change notification settings - Fork 88
Beatwise TF matrix (or multibeat) #162
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
base: main
Are you sure you want to change the base?
Conversation
Also add writing and reading to json, and new FeatureTypes : (est/ann)_beatsync_features_mfpb. I had to refactor the compute_beatsync_features, but the changes shouldn't affect other usages.
Had to refactor the computing of frames and times to do this.
The way I did it before didn't work and had no advantages
Also add FramesPerBeatTooHigh exceptions and remove padbeats (unused functions)
urinieto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a great PR! This is a lot, but I think this is the cleanest way without having to do a massive refactoring on metafeatures. I just left a couple of minor comments regarding documentation. I am running the tests now with Github Actions. If they pass, I will merge away after the docstring typos/requests are addressed. Thanks!
|
Apologies, I realized I never get back on this! Some of the tests didn't pass. @Yoz0 , could you please make sure all tests pass? Once they do, I'll merge this PR. Thanks! |
This PR add a new feature representation with a fixed number of frames per beats. This is an advancement of issue #154 , but on beats instead of bars.
For the user this adds :
frames_per_beat(int, default 3). The number of frames sampled for each beat.Feature:multibeat(bool, default False). Whether to use this representation or not.run_MSAF.py:-mb. To use this representation.In the
Featureclass :self._est_multibeat_featuresandself._ann_mutlibeat_featureswhere the representation will be for resp. estimated beats and annotated beats.self._est_multibeat_framesandself._ann_multibeat_frameswith the frame index of the beats. (We remove the last beat fromself._est_beatsync_frames, because we compute frames between beats)self._est_multibeat_timesandself._ann_multibeat_timeswith the times in secondes of the beats._compute_multibeat(self, beat_frames)to compute the index of the frames used for the representation_shape_beatwise(self, multibeat_features)to stack the feature representation as a beatwise TF matrix.compute_beat_sync_featuresin order to use the same function to compute multibeat features. The padding ofbeat_timesis moved to a new function called_pad_beats_timesFeatureTypes:est_multibeatandann_multibeatand the appropriate code inselect_features(...)FramesPerBeatTooHighraised by '_compute_multibeat()if the number of frames between two beats is lower thanframes_per_beat`.test_multibeat.pyThanks for reading, and reviewing code 😃