Skip to content

[speech] Kolesnichenko#1

Open
larkkin wants to merge 2 commits intoRauf-Kurbanov:masterfrom
larkkin:task01
Open

[speech] Kolesnichenko#1
larkkin wants to merge 2 commits intoRauf-Kurbanov:masterfrom
larkkin:task01

Conversation

@larkkin
Copy link

@larkkin larkkin commented Jan 23, 2019

No description provided.

Copy link
Owner

@Rauf-Kurbanov Rauf-Kurbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, just take care of minor comments and you got yourself the full grade :)

`python create_noised_copy.py <input dir>`


Dependencies:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use requirements.txt

data, _ = librosa.core.load(file_path, sr)
return data, _

noise_dir = "../../bg_noise/"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this default params to Argparse

return data, _

noise_dir = "../../bg_noise/"
beeps_dir = noise_dir + "/FRESOUND_BEEPS_gsm/train/"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use os.path.join

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use magic constants, make parameters

files = os.listdir(dst_dir)
for filename in files:
if filename[-4:] != '.wav' and filename[-5:] != '.flac':
os.remove(dst_dir + filename)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing files from the filesystem for the wrong extensions seem a little harsh

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix this

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]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also os.path.join

Copy link
Owner

@Rauf-Kurbanov Rauf-Kurbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now: 4/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants