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
Issue 764: Switch Pitch Detection Test to use On the Fly Generation instead of file. #783
Conversation
Maybe there is no point in trying to use on the fly generation if we have to keep |
Yes, the problem is that the code used to generate those This situation is very bad because resample is used in other places too resample function has to be tested thoroughly but the data stored as |
test/functional_cpu_test.py
Outdated
@@ -300,19 +300,23 @@ def test_linearity_of_istft4(self): | |||
|
|||
class TestDetectPitchFrequency(common_utils.TorchaudioTestCase): | |||
def test_pitch(self): | |||
test_filepath_100 = common_utils.get_asset_path("100Hz_44100Hz_16bit_05sec.wav") | |||
test_filepath_440 = common_utils.get_asset_path("440Hz_44100Hz_16bit_05sec.wav") | |||
SAMPLE_RATE = 44100 |
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.
Why is this variable capitalized?
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.
I was thinking this is a constant per https://www.python.org/dev/peps/pep-0008/#id48? What case would you prefer?
Let's address this in a follow up. |
2. Relax rtol from 1e-8 to 1e-7 for compliance kaldi 3. Switch to on the fly generation for batch pitch tests
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.
Looks good. Added suggestions for further simplification.
def convert_tensor_encoding( | ||
tensor: torch.tensor, | ||
dtype: torch.dtype, | ||
): |
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.
Nice!
Codecov Report
@@ Coverage Diff @@
## master #783 +/- ##
==========================================
- Coverage 89.78% 89.53% -0.26%
==========================================
Files 34 32 -2
Lines 2654 2617 -37
==========================================
- Hits 2383 2343 -40
- Misses 271 274 +3
Continue to review full report at Codecov.
|
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.
Looks almost good. One clean up remaining.
Thanks! |
test_compliance_kaldi.py
. Cannot get rid ofkaldi_file_8000.wav
because we compare the output to correspondingark
files.