Files
UltraSinger/pytest/modules/Pitcher/test_pitcher.py
T
Benedikt Wagener de45b7c96a downgrade tensorflow dependency, improve plot, add timer
downgrade tensorflow dependency to last version with gpu support for windows
update plot to be a linear progression between notes on the y axis and include confidence information
add timer component to measure process time
2023-09-13 23:56:42 +02:00

28 lines
1.0 KiB
Python

"""Tests for pitcher.py"""
import os
import unittest
import src.modules.Pitcher.pitcher as test_subject
import pytest
from src.modules.plot import plot
class PitcherTest(unittest.TestCase):
@pytest.mark.skip(reason="Skipping this FUNCTION level test, can be used for manual tests")
def test_get_pitch_with_crepe_file(self):
# Arrange
test_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.abspath(test_dir + "/../../..")
# test_file_abs_path = os.path.abspath(root_dir + "/test_input/audio_denoised.wav")
test_file_abs_path = os.path.abspath(root_dir + "/test_input/test_denoised.wav")
test_output = root_dir + "/test_output"
# Act
pitched_data = test_subject.get_pitch_with_crepe_file(test_file_abs_path, 'full', device="cuda")
# test_subject.get_pitch_with_crepe_file(test_file_abs_path, 'full', 'cpu', batch_size=1024)
plot(pitched_data, test_output, title="pitching test")
print("done")
if __name__ == "__main__":
unittest.main()