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

added a little helper function to vggish to get features from waveforms #31

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

bmcfee
Copy link
Collaborator

@bmcfee bmcfee commented Sep 19, 2018

Now you can get features directly from waveforms by saying

times, features = openmic.vggish.waveform_to_features(data, rate, compress=True|False)

with compress=True (default), the outputs are whitened and quantized. With compress=False they are left as is from the model.

This should simplify doing one-off feature extraction in our notebook demos, even if it's less efficient than going through featurefy.

@bmcfee bmcfee added the enhancement New feature or request label Sep 19, 2018
@bmcfee bmcfee requested a review from ejhumphrey September 19, 2018 16:48
@bmcfee
Copy link
Collaborator Author

bmcfee commented Sep 19, 2018

NB: tests pass and coverage is good locally, i anticipate no problems even if travis takes forever.

@coveralls
Copy link

coveralls commented Sep 19, 2018

Pull Request Test Coverage Report for Build 63

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 94.694%

Totals Coverage Status
Change from base Build 59: 0.6%
Covered Lines: 232
Relevant Lines: 245

💛 - Coveralls


Returns
-------
time_points : np.ndarray, len=n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per #29, we're making a conscious decision to converge to time_points then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I literally just copied over from the existing functions. If we rename, we should do it all at once, and i think it's independent of this pr.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The output features, with or without PCA compression and quantization.
'''

import tensorflow as tf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the rationale for within-function importing here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tf import is heavy (sometimes); we shouldn't do it until called for.

If it's already been loaded elsewhere, then this is free.

Copy link
Contributor

@ejhumphrey ejhumphrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than that import, LGTM

@bmcfee bmcfee merged commit 70d3b94 into master Sep 19, 2018
@bmcfee bmcfee deleted the openmic-vggish-extract branch September 19, 2018 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants