Datasets:
add json file with info
Browse files- create_json.py +31 -0
- files.json +0 -0
create_json.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Create a JSON file mapping of available audio files to the TTS models that generated them.
|
| 2 |
+
|
| 3 |
+
The output JSON has the following structure:
|
| 4 |
+
{
|
| 5 |
+
"path1.mp3": [
|
| 6 |
+
"model1",
|
| 7 |
+
"model2",
|
| 8 |
+
...
|
| 9 |
+
],
|
| 10 |
+
"path2.mp3": [
|
| 11 |
+
"model1",
|
| 12 |
+
...
|
| 13 |
+
],
|
| 14 |
+
...
|
| 15 |
+
}
|
| 16 |
+
"""
|
| 17 |
+
from collections import defaultdict
|
| 18 |
+
import json
|
| 19 |
+
import os
|
| 20 |
+
import pandas as pd
|
| 21 |
+
|
| 22 |
+
df = pd.read_csv("metadata-balanced.csv")
|
| 23 |
+
models = ["commonvoice", "metavoice", "playht", "stylettsv2", "xttsv2"]
|
| 24 |
+
ds = defaultdict(list)
|
| 25 |
+
for path in df.path:
|
| 26 |
+
for model in models:
|
| 27 |
+
if os.path.exists(os.path.join(model, path)):
|
| 28 |
+
ds[path].append(model)
|
| 29 |
+
|
| 30 |
+
with open("files.json", "w") as json_file:
|
| 31 |
+
json.dump(ds, json_file, indent=4)
|
files.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|