Commit 40267ee9 authored by paul's avatar paul
Browse files

add uid to output

parent 77f5fd75
...@@ -163,6 +163,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops, ...@@ -163,6 +163,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops,
line = genders[gender_selected].pop() line = genders[gender_selected].pop()
# get meta data # get meta data
uid = line[0]
mp3_filename = line[1] mp3_filename = line[1]
age = line[5] age = line[5]
gender = line[6] gender = line[6]
...@@ -202,7 +203,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops, ...@@ -202,7 +203,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops,
wav_path = os.path.join(output_dir_wav, chip_name + ".wav") wav_path = os.path.join(output_dir_wav, chip_name + ".wav")
wav.write(wav_path, chip_fs, chip_data) wav.write(wav_path, chip_fs, chip_data)
output_clips.append([chip_name + ".wav", age, gender, accent, locale]) output_clips.append([chip_name + ".wav", age, gender, accent, locale, uid])
gender_counter[gender_selected] += 1 gender_counter[gender_selected] += 1
# remove the intermediate file # remove the intermediate file
...@@ -216,7 +217,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops, ...@@ -216,7 +217,7 @@ def traverse_csv(language, input_dir, output_dir, max_chops,
# --- end loop --- # --- end loop ---
# write to csv # write to csv
column_names = ["path", "age", "gender", "accent", "locale"] column_names = ["path", "age", "gender", "accent", "locale", "uid"]
pd.DataFrame(output_clips, columns = column_names).to_csv(output_clips_file, sep='\t') pd.DataFrame(output_clips, columns = column_names).to_csv(output_clips_file, sep='\t')
produced_files = sum(gender_counter) produced_files = sum(gender_counter)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment