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

Looping audio #136

Closed
wants to merge 12 commits into from
Closed

Looping audio #136

wants to merge 12 commits into from

Conversation

iAdityaEmpire
Copy link
Contributor

@iAdityaEmpire iAdityaEmpire commented Oct 6, 2021

Related Issue

Fixes #129

Summary

  • I have read CONTRIBUTING.md to understand how to contribute to this repository :)

<Please summarize what you are trying to achieve, what changes you made, and how they achieve the desired result.>
Preliminary loop augmentation for the audio modality, yet to add stereo test_loop_audio.wave

Unit Tests

If your changes touch the audio module, please run all of the audio tests and paste the output here. Likewise for image, text, & video. If your changes could affect behavior in multiple modules, please run the tests for all potentially affected modules. If you are unsure of which modules might be affected by your changes, please just run all the unit tests.

Audio

python -m unittest discover -s augly/tests/audio_tests/ -p "*"

......./home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:2099: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.dtype(np.float): np.complex,
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:2099: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.dtype(np.float): np.complex,
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:869: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  mag = np.abs(S).astype(np.float)
........../home/adityaprasad/.local/lib/python3.8/site-packages/librosa/core/spectrum.py:1223: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  time_steps = np.arange(0, D.shape[1], rate, dtype=np.float)
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:2099: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.dtype(np.float): np.complex,
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:2099: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.dtype(np.float): np.complex,
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/core/spectrum.py:1223: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  time_steps = np.arange(0, D.shape[1], rate, dtype=np.float)
/home/adityaprasad/.local/lib/python3.8/site-packages/librosa/util/utils.py:869: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  mag = np.abs(S).astype(np.float)
...................................................
----------------------------------------------------------------------
Ran 68 tests in 4.976s

OK

Image

python -m unittest discover -s augly/tests/image_tests/ -p "*_test.py"
# Or `python -m unittest discover -s augly/tests/image_tests/ -p "*.py"` to run pytorch test too (must install `torchvision` to run)

Text

python -m unittest discover -s augly/tests/text_tests/ -p "*"

Video

python -m unittest discover -s augly/tests/video_tests/ -p "*"

All

python -m unittest discover -s augly/tests/ -p "*"

Other testing

If applicable, test your changes and paste the output here. For example, if your changes affect the requirements/installation, then test installing augly in a fresh conda env, then make sure you are able to import augly & run the unit test

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 6, 2021
@iAdityaEmpire iAdityaEmpire changed the title unfinished audio loop commits Looping audio Oct 7, 2021
Copy link
Contributor Author

@iAdityaEmpire iAdityaEmpire left a comment

Choose a reason for hiding this comment

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

Have yet to add an sf.write() for the stereo audio, slightly confused on how the implementation would be different from the mono version (which was the default)

Copy link
Contributor

@zpapakipos zpapakipos left a comment

Choose a reason for hiding this comment

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

Have yet to add an sf.write() for the stereo audio, slightly confused on how the implementation would be different from the mono version (which was the default)

You can just call ret_and_save_audio from augly.audio.utils! It works for any number of channels & different audio formats.

augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/intensity.py Outdated Show resolved Hide resolved
@iAdityaEmpire
Copy link
Contributor Author

still a WIP I think somehow the last commit overwrote all the previous edit history

@iAdityaEmpire
Copy link
Contributor Author

@zpapakipos @jbitton The test_python check is apparently failing on the installation of pytorch, but my local tests are passing. Is this something I should somehow fix?

@iAdityaEmpire iAdityaEmpire marked this pull request as ready for review October 20, 2021 23:36
Copy link
Contributor

@jbitton jbitton left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me! So sorry that you had to go through all those merge conflicts / essentially re-do the PR. Good news is that you're some nits away from getting your first AugLy PR landed!!!

That issue in the GitHub workflow shouldn't be your fault. Once you address these nits etc, let's see if the tests now pass / if it was a transient error. If not, @zpapakipos and I will look into it more -- it could be that one of our dependencies got a new update and now something isn't working.

augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/transforms.py Outdated Show resolved Hide resolved
augly/tests/audio_tests/functional_unit_test.py Outdated Show resolved Hide resolved
augly/tests/audio_tests/intensity_unit_test.py Outdated Show resolved Hide resolved
augly/tests/audio_tests/transforms_unit_test.py Outdated Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@jbitton jbitton left a comment

Choose a reason for hiding this comment

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

Overall LGTM! A couple teeny tiny nits (mostly just adding newlines) and we're done! Btw, I ran your code internally and it passes :)

augly/audio/__init__.py Outdated Show resolved Hide resolved
augly/audio/functional.py Outdated Show resolved Hide resolved
augly/audio/intensity.py Outdated Show resolved Hide resolved
augly/audio/transforms.py Outdated Show resolved Hide resolved
iAdityaEmpire and others added 4 commits October 21, 2021 18:03
Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com>
Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com>
Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com>
Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com>
@iAdityaEmpire
Copy link
Contributor Author

@jbitton Got it! The new commits should be there now.

@jbitton
Copy link
Contributor

jbitton commented Oct 22, 2021

Looks fantastic @iAdityaEmpire !!!!!!

@facebook-github-bot
Copy link
Contributor

@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@jbitton merged this pull request in 785e35b.

@iAdityaEmpire iAdityaEmpire deleted the base/loop_audio branch October 22, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MLH Fellow] [Audio] Add loop augmentation
4 participants