Open
Conversation
Rauf-Kurbanov
requested changes
Feb 1, 2019
Owner
Rauf-Kurbanov
left a comment
There was a problem hiding this comment.
Good job, just take care of minor comments and you got yourself the full grade :)
| `python create_noised_copy.py <input dir>` | ||
|
|
||
|
|
||
| Dependencies: |
create_noised_copy.py
Outdated
| data, _ = librosa.core.load(file_path, sr) | ||
| return data, _ | ||
|
|
||
| noise_dir = "../../bg_noise/" |
Owner
There was a problem hiding this comment.
make this default params to Argparse
create_noised_copy.py
Outdated
| return data, _ | ||
|
|
||
| noise_dir = "../../bg_noise/" | ||
| beeps_dir = noise_dir + "/FRESOUND_BEEPS_gsm/train/" |
create_noised_copy.py
Outdated
| music = random.choice(musics) | ||
| cycled_beep = cycle_for_length_with_silence(beep, data.shape[0], 1.0) | ||
| cycled_music = cycle_for_length_with_silence(music, data.shape[0], 0.1) | ||
| return 0.2 * cycled_beep + 0.2 * cycled_music + 0.6 * data |
Owner
There was a problem hiding this comment.
please do not use magic constants, make parameters
create_noised_copy.py
Outdated
| files = os.listdir(dst_dir) | ||
| for filename in files: | ||
| if filename[-4:] != '.wav' and filename[-5:] != '.flac': | ||
| os.remove(dst_dir + filename) |
Owner
There was a problem hiding this comment.
removing files from the filesystem for the wrong extensions seem a little harsh
create_noised_copy.py
Outdated
| def main(): | ||
| beeps_files = os.listdir(beeps_dir) | ||
| music_files = os.listdir(music_dir) | ||
| beeps = [load_audio(beeps_dir + filename)[0] for filename in beeps_files] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.