Add data folder to repo
This commit is contained in:
parent
af26da8cad
commit
cfdab59a34
2 changed files with 77 additions and 0 deletions
29
data/make_text.py
Normal file
29
data/make_text.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import os
|
||||
import random
|
||||
import librosa
|
||||
|
||||
file_path = 'VCTK-Corpus/wav48'
|
||||
dataset_path = './multispeaker'
|
||||
|
||||
folders = os.listdir(file_path)
|
||||
|
||||
for folder in folders:
|
||||
if folder == '.DS_Store':
|
||||
folders.remove(folder)
|
||||
print (folders)
|
||||
|
||||
for folder in folders:
|
||||
files = os.listdir(os.path.join(file_path, folder))
|
||||
random.shuffle(files)
|
||||
for file in files:
|
||||
if len(x) < 10:
|
||||
input('This file is corrupted')
|
||||
u = random.uniform(0,1) # a single value is returned between 0 and 1
|
||||
if u > 0.1:
|
||||
with open(f'{dataset_path}/train-files1.txt', 'a+') as text_file:
|
||||
text_file.write(f'{file_path}/{folder}/{file}')
|
||||
text_file.write('\n')
|
||||
if u < 0.1:
|
||||
with open(f'{dataset_path}/val-files1.txt', 'a+') as text_file:
|
||||
text_file.write(f'{file_path}/{folder}/{file}')
|
||||
text_file.write('\n')
|
||||
Loading…
Reference in a new issue