From d273f7e12693e5b366cbf2ff7d01dde0264b01d9 Mon Sep 17 00:00:00 2001
From: 嘉渊 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期五, 21 七月 2023 14:26:15 +0800
Subject: [PATCH] update
---
egs/callhome/eend_ola/local/gen_feats_scp.py | 26 ++++++++++++--------------
egs/callhome/eend_ola/run_test.sh | 4 ++--
2 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/egs/callhome/eend_ola/local/gen_feats_scp.py b/egs/callhome/eend_ola/local/gen_feats_scp.py
index 5667f82..88a94f2 100644
--- a/egs/callhome/eend_ola/local/gen_feats_scp.py
+++ b/egs/callhome/eend_ola/local/gen_feats_scp.py
@@ -9,19 +9,17 @@
args = parser.parse_args()
root_path = args.root_path
out_path = args.out_path
- datasets = ["train", "dev"]
split_num = args.split_num
- for dataset in datasets:
- with open(os.path.join(out_path, dataset, "feats.scp"), "w") as out_f:
- for i in range(split_num):
- idx = str(i + 1)
- feature_file = os.path.join(root_path, dataset, "feature.scp.{}".format(idx))
- label_file = os.path.join(root_path, dataset, "label.scp.{}".format(idx))
- with open(feature_file) as ff, open(label_file) as fl:
- ff_lines = ff.readlines()
- fl_lines = fl.readlines()
- for ff_line, fl_line in zip(ff_lines, fl_lines):
- sample_name, f_path = ff_line.strip().split()
- _, l_path = fl_line.strip().split()
- out_f.write("{} {} {}\n".format(sample_name, f_path, l_path))
\ No newline at end of file
+ with open(os.path.join(out_path, "feats.scp"), "w") as out_f:
+ for i in range(split_num):
+ idx = str(i + 1)
+ feature_file = os.path.join(root_path, "feature.scp.{}".format(idx))
+ label_file = os.path.join(root_path, "label.scp.{}".format(idx))
+ with open(feature_file) as ff, open(label_file) as fl:
+ ff_lines = ff.readlines()
+ fl_lines = fl.readlines()
+ for ff_line, fl_line in zip(ff_lines, fl_lines):
+ sample_name, f_path = ff_line.strip().split()
+ _, l_path = fl_line.strip().split()
+ out_f.write("{} {} {}\n".format(sample_name, f_path, l_path))
\ No newline at end of file
diff --git a/egs/callhome/eend_ola/run_test.sh b/egs/callhome/eend_ola/run_test.sh
index 02c51f6..77aa08d 100644
--- a/egs/callhome/eend_ola/run_test.sh
+++ b/egs/callhome/eend_ola/run_test.sh
@@ -101,8 +101,8 @@
# --index JOB
mkdir -p ${data_dir}/ark_data/dump/simu_data/data/$dataset
python local/gen_feats_scp.py \
- --root_path ${data_dir}/ark_data/dump/simu_data \
- --out_path ${data_dir}/ark_data/dump/simu_data/data \
+ --root_path ${data_dir}/ark_data/dump/simu_data/$dataset \
+ --out_path ${data_dir}/ark_data/dump/simu_data/data/$dataset \
--split_num $nj
done
fi
--
Gitblit v1.9.1