Revert files under test

This commit is contained in:
Vadim committed 2024-06-24 22:00:13 +02:00
1 parent eef3d62533
commit 005b3a816f
2 files changed
+27 -12

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
"""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()
-12
View File
@@ -102,18 +102,6 @@ def create_midi_notes_from_pitched_data(start_times: list[float], end_times: lis
word = str(words[index])
midi_segment = create_midi_note_from_pitched_data(start_time, end_time, pitched_data, word)
# segment_count = len(midi_segment)
# if segment_count > 1:
# for index, midi_segment in enumerate(midi_segment[1:]):
# midi_segment.word = "~"
#
# if word.endswith(" "):
# word = word[:-1]
# midi_segment[-1].word += " "
#
#midi_segment[0].word = word
#new_segments.extend(midi_segment)
new_segments.append(midi_segment)
# todo: Progress?