Skip to content

Commit dba228a

Browse files
Merge pull request #21 from schuler-henry/20-clean-up-code
Updated and deleted code items.
2 parents 12db90e + 4505247 commit dba228a

File tree

14 files changed

+5
-382
lines changed

14 files changed

+5
-382
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
old/
22
main.pdf
33
.vscode/
4+
__pycache__/
45

56
## Core latex/pdflatex auxiliary files:
67
*.aux

code/AudioPreprocessor/AudioPreprocessor.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,3 @@ def load_preprocessed_frames(filepath=None, y=None, sr=None):
127127
windowed_frames = AudioPreprocessor.window_frames(frames=frames)
128128

129129
return windowed_frames
130-
131-
def main():
132-
frames = AudioPreprocessor.load_preprocessed_frames("./audio.wav")
133-
print(frames)
134-
135-
if __name__ == '__main__':
136-
main()
Binary file not shown.
Binary file not shown.

code/FeatureEvaluator/FeatureEvaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def create_dataset(self, speaker_ids, extraction_pattern, frames_per_chunk, chun
7878
print()
7979

8080
dataset.extend(chunks[:chunks_per_speaker])
81-
# create numpy array that has 200 times value 1
81+
# create numpy array that has chunks_per_speaker times value speaker_id
8282
dataset_speaker_ids.extend(np.full((chunks_per_speaker), speaker_id))
8383

8484
print("Dataset created.")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

code/main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
from AudioPreprocessor.AudioPreprocessor import AudioPreprocessor
2-
from FeatureExtractor.FeatureExtractor import FeatureExtractor, Feature
1+
from FeatureExtractor.FeatureExtractor import Feature
32
from FeatureEvaluator.FeatureEvaluator import FeatureEvaluator
43

5-
import librosa
64
import numpy as np
75

86
def main():
97
evaluator = FeatureEvaluator("/home/henry/Downloads/archive/50_speakers_audio_data")
108

11-
X, y = evaluator.create_dataset([0, 1, 2, 3, 4], [[Feature.LPC, 13, []]], 10, 200, 4410, 2205, np.hanning, start_at_file_index=0)
9+
X, y = evaluator.create_dataset([0, 1, 2, 3, 4], [[Feature.LPC, 13, []]], 30, 1000, 500, 100, np.hanning, start_at_file_index=0)
1210
evaluator.set_model_dataset(X, y)
1311

14-
X, y = evaluator.create_dataset([0, 1, 2, 3, 4], [[Feature.LPC, 13, []]], 10, 200, 4410, 2205, np.hanning, start_at_file_index=12)
12+
X, y = evaluator.create_dataset([0, 1, 2, 3, 4], [[Feature.LPC, 13, []]], 30, 1000, 500, 100, np.hanning, start_at_file_index=15)
1513
evaluator.set_evaluation_dataset(X, y)
1614

1715
evaluator.create_nn_model(epochs=1000)
1816

1917
evaluator.evaluate_model()
2018

21-
2219
if __name__ == "__main__":
2320
main()

code/test.ipynb

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)