audio icon indicating copy to clipboard operation
audio copied to clipboard

Add example codes for documentation

Open harishsdev opened this issue 4 years ago • 18 comments

📚 Documentation

I have observed that Example codes are missing from Documentation for the below mentioned Classes from torchaudio, Can I Raise PR for it

Group A

  • [x] Spectrogram PR:https://github.com/pytorch/audio/pull/1566
  • [x] GriffinLim PR:https://github.com/pytorch/audio/pull/1671/
  • [ ] AmplitudeToDB
  • [ ] MelScale
  • [ ] InverseMelScale
  • [ ] MFCC
  • [x] MuLawEncoding PR:https://github.com/pytorch/audio/pull/1586
  • [x] MuLawDecoding PR:https://github.com/pytorch/audio/pull/1684
  • [ ] SpectralCentroid

Group B

  • [x] Resample PR:https://github.com/pytorch/audio/pull/1644
  • [x] ComplexNorm PR:https://github.com/pytorch/audio/pull/1658
  • [x] ComputeDeltas
  • [ ] TimeStretch
  • [x] Fade

Group C

  • [ ] FrequencyMasking
  • [ ] TimeMasking
  • [x] Vol
  • [x] SlidingWindowCmn
  • [x] Vad

harishsdev avatar Jun 10 '21 12:06 harishsdev

Hi @harishsdev

Yes, this will be a great addition. Feel free to add PRs. However, please split PRs for each class, (make one PR per class) so that it is easier to review.

Also, some of them are covered in tutorial, so please have a look it as well. https://pytorch.org/tutorials/beginner/audio_preprocessing_tutorial.html#feature-extractions

mthrok avatar Jun 10 '21 12:06 mthrok

I will make this issue open for contribution.

mthrok avatar Jun 10 '21 12:06 mthrok

I am working on Group A

harishsdev avatar Jun 10 '21 12:06 harishsdev

@mthrok please help to review

harishsdev avatar Jul 01 '21 05:07 harishsdev

After following the instructions given in contributing.md for development and installation, when I am trying to build docs locally I am getting this error after running make html

Running Sphinx v2.4.4
checking for /home/vivek_kumar/OpenSource/audio/docs/source/refs.bib in bibtex cache... not found
parsing bibtex file /home/vivek_kumar/OpenSource/audio/docs/source/refs.bib... parsed 10 entries
loading intersphinx inventory from https://docs.python.org/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://pytorch.org/docs/stable/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 12 source files that are out of date
updating environment: [new config] 12 added, 0 changed, 0 removed
reading sources... [  8%] backend
reading sources... [ 16%] compliance.kaldi
reading sources... [ 25%] datasets
reading sources... [ 33%] functional
reading sources... [ 41%] index
reading sources... [ 50%] kaldi_io
reading sources... [ 58%] models
reading sources... [ 66%] rnnt_loss
reading sources... [ 75%] sox_effects
reading sources... [ 83%] torchaudio
reading sources... [ 91%] transforms
reading sources... [100%] utils

Warning, treated as error:
autodoc: failed to import class 'backend.common.AudioMetaData' from module 'torchaudio'; the following exception was raised:
No module named 'torchaudio'
Makefile:27: recipe for target 'html' failed
make: *** [html] Error 2

@mthrok please help me out to overcome this error!

vivekkumar7089 avatar Jul 16 '21 07:07 vivekkumar7089

Can I start working on Group B?

radioactive11 avatar Jul 27 '21 16:07 radioactive11

Hi @radioactive11! Sure, feel free to create a PR for each class in Group B.

nateanl avatar Jul 27 '21 17:07 nateanl

@nateanl Thank you for letting me work on this issue. I am new to the repo. Should I add an example like this one?

radioactive11 avatar Jul 27 '21 17:07 radioactive11

@nateanl Thank you for letting me work on this issue. I am new to the repo. Should I add an example like this one?

Yes, exactly. You can see @harishsdev's #1566 as an example.

nateanl avatar Jul 27 '21 17:07 nateanl

Hey Can I work on this issue?

chiragoel avatar Jan 09 '22 18:01 chiragoel

Hi @chiragoel

Sure go ahead.

mthrok avatar Jan 18 '22 16:01 mthrok

Hi there - it looks like Group C is still open, so I thought I'd work on that.

Also note that FrequencyMasking and TimeMasking from Group C already have examples, but are still unchecked in the original post of this PR (I don't have access to check them off.)

ravicodelabs avatar Jul 31 '22 18:07 ravicodelabs

I believe Group C transforms should all have examples now, with the last two pending review.

@harishsdev Just checking if you were still planning on finishing up examples for Group A. If not, I'd be happy to work on those to help nudge this issue closer to being closed. :) I will give it a week for your response before working on Group A, in case you do plan to work on them.

If my tally is correct, the following transformations still need examples for Group A:

  • AmplitudeToDB
  • MelScale
  • InverseMelScale
  • MFCC

It seems that SpectralCentroid from Group A is currently unchecked in the first post of this issue, but I see that an example has already been added.

Thanks!

ravicodelabs avatar Aug 03 '22 14:08 ravicodelabs

Per my last post here, I am starting work on the remaining examples for Group A, beginning with AmplitudeToDB.

ravicodelabs avatar Aug 14 '22 16:08 ravicodelabs

Hi! It would be great to get feedback on the below:

We are getting close to completing all of the examples Harish originally proposed in this issue. However, there are some torchaudio transforms in the source code which are not in the original list here (perhaps some were added later). Some of these transforms also do not have examples yet, for instance: LFCC and SoudenMVDR.

Would it make sense to add a new group for these transforms that are not already listed in this issue, or create a new issue, or something else? Has a full tally of examples been done already or would this be a helpful addition?

ravicodelabs avatar Aug 19 '22 14:08 ravicodelabs

Hi @ravimakhija, thanks for working on group A. I think adding a new group for the rest of transforms modules is a good idea.

nateanl avatar Aug 19 '22 19:08 nateanl

Sounds good - I don't think I have permissions to edit the original post, so I will plan to add a new group as a new comment.

ravicodelabs avatar Aug 19 '22 19:08 ravicodelabs

Hi All-

After tallying the remaining transform examples using the main branch source code (as of commit 533f87), I have the following three updates:

  1. All of the examples in group A, group B, and group C except for one (ComputeDeltas) are now included in the main branch. Hence, they can be checked off in Harish's original post (by anyone who has the permissions to do so).
  2. The ComputeDeltas transform is checked off in Harish's original post, but it has not been merged yet (please see PR #2197).
  3. There are six transforms that still need examples added, for which I am adding group D below. I plan to start working on adding these from the top down (e.g. starting with LFCC).

Group D:

  • [x] LFCC
  • [x] Loudness
  • [ ] MVDR
  • [ ] SoudenMVDR
  • [ ] RTFMVDR
  • [ ] PSD

ravicodelabs avatar Aug 21 '22 13:08 ravicodelabs