Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
old/
main.pdf
.vscode/
__pycache__/

## Core latex/pdflatex auxiliary files:
*.aux
Expand Down
7 changes: 0 additions & 7 deletions code/AudioPreprocessor/AudioPreprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,3 @@ def load_preprocessed_frames(filepath=None, y=None, sr=None):
windowed_frames = AudioPreprocessor.window_frames(frames=frames)

return windowed_frames

def main():
frames = AudioPreprocessor.load_preprocessed_frames("./audio.wav")
print(frames)

if __name__ == '__main__':
main()
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion code/FeatureEvaluator/FeatureEvaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def create_dataset(self, speaker_ids, extraction_pattern, frames_per_chunk, chun
print()

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

print("Dataset created.")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 3 additions & 6 deletions code/main.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
from AudioPreprocessor.AudioPreprocessor import AudioPreprocessor
from FeatureExtractor.FeatureExtractor import FeatureExtractor, Feature
from FeatureExtractor.FeatureExtractor import Feature
from FeatureEvaluator.FeatureEvaluator import FeatureEvaluator

import librosa
import numpy as np

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

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

X, y = evaluator.create_dataset([0, 1, 2, 3, 4], [[Feature.LPC, 13, []]], 10, 200, 4410, 2205, np.hanning, start_at_file_index=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)
evaluator.set_evaluation_dataset(X, y)

evaluator.create_nn_model(epochs=1000)

evaluator.evaluate_model()


if __name__ == "__main__":
main()
236 changes: 0 additions & 236 deletions code/test.ipynb

This file was deleted.

Loading