forked from RetroCirce/Zero_Shot_Audio_Source_Separation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_balanced_list.py
More file actions
24 lines (21 loc) · 849 Bytes
/
create_balanced_list.py
File metadata and controls
24 lines (21 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Ke Chen
# knutchen@ucsd.edu
import os
import sys
import config
import logging
import numpy as np
from utils import get_balanced_class_list
def main():
train_indexes_hdf5_path = os.path.join(config.dataset_path, "hdf5s", "indexes",
"{}.h5".format(config.data_type))
eval_indexes_hdf5_path = os.path.join(config.dataset_path, "hdf5s", "indexes", "eval.h5")
logging.info("Process training data")
indexes_per_class = get_balanced_class_list(train_indexes_hdf5_path, random_seed = config.random_seed)
np.save("idc_train.npy", indexes_per_class)
logging.info("Process testing data")
indexes_per_class = get_balanced_class_list(eval_indexes_hdf5_path, random_seed = config.random_seed)
np.save("idc_eval.npy", indexes_per_class)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
main()