nkululeko 0.90.3__py3-none-any.whl → 0.91.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nkululeko/constants.py +1 -1
- nkululeko/multidb.py +5 -1
- nkululeko/segment.py +2 -32
- nkululeko/segmenting/seg_silero.py +35 -9
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/METADATA +10 -1
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/RECORD +10 -10
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/WHEEL +1 -1
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/LICENSE +0 -0
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/entry_points.txt +0 -0
- {nkululeko-0.90.3.dist-info → nkululeko-0.91.0.dist-info}/top_level.txt +0 -0
nkululeko/constants.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
VERSION="0.
|
1
|
+
VERSION="0.91.0"
|
2
2
|
SAMPLING_RATE = 16000
|
nkululeko/multidb.py
CHANGED
@@ -115,7 +115,11 @@ def main(src_dir):
|
|
115
115
|
print(repr(results))
|
116
116
|
print(repr(last_epochs))
|
117
117
|
root = os.path.join(config["EXP"]["root"], "")
|
118
|
-
|
118
|
+
try:
|
119
|
+
format = config["PLOT"]["format"]
|
120
|
+
plot_name = f"{root}/heatmap.{format}"
|
121
|
+
except KeyError:
|
122
|
+
plot_name = f"{root}/heatmap.png"
|
119
123
|
plot_heatmap(results, last_epochs, datasets, plot_name, config, datasets)
|
120
124
|
|
121
125
|
|
nkululeko/segment.py
CHANGED
@@ -7,9 +7,9 @@ import os
|
|
7
7
|
|
8
8
|
import pandas as pd
|
9
9
|
|
10
|
-
import nkululeko.glob_conf as glob_conf
|
11
10
|
from nkululeko.constants import VERSION
|
12
11
|
from nkululeko.experiment import Experiment
|
12
|
+
import nkululeko.glob_conf as glob_conf
|
13
13
|
from nkululeko.reporting.report_item import ReportItem
|
14
14
|
from nkululeko.utils.util import Util
|
15
15
|
|
@@ -78,6 +78,7 @@ def main():
|
|
78
78
|
|
79
79
|
if "duration" not in df.columns:
|
80
80
|
df["duration"] = df.index.to_series().map(lambda x: calc_dur(x))
|
81
|
+
df_seg["duration"] = df_seg.index.to_series().map(lambda x: calc_dur(x))
|
81
82
|
num_before = df.shape[0]
|
82
83
|
num_after = df_seg.shape[0]
|
83
84
|
# plot distributions
|
@@ -115,36 +116,5 @@ def main():
|
|
115
116
|
print("DONE")
|
116
117
|
|
117
118
|
|
118
|
-
def get_segmentation(file):
|
119
|
-
# print(f'segmenting {file[0]}')
|
120
|
-
print(".", end="")
|
121
|
-
wav = read_audio(file[0], sampling_rate=SAMPLING_RATE)
|
122
|
-
speech_timestamps = get_speech_timestamps(
|
123
|
-
wav, vad_model, sampling_rate=SAMPLING_RATE
|
124
|
-
)
|
125
|
-
files, starts, ends = [], [], []
|
126
|
-
for entry in speech_timestamps:
|
127
|
-
start = float(entry["start"] / 1000.0)
|
128
|
-
end = float(entry["end"] / 1000.0)
|
129
|
-
files.append(file[0])
|
130
|
-
starts.append(start)
|
131
|
-
ends.append(end)
|
132
|
-
seg_index = segmented_index(files, starts, ends)
|
133
|
-
return seg_index
|
134
|
-
|
135
|
-
|
136
|
-
def segment_dataframe(df):
|
137
|
-
dfs = []
|
138
|
-
for file, values in df.iterrows():
|
139
|
-
index = get_segmentation(file)
|
140
|
-
dfs.append(
|
141
|
-
pd.DataFrame(
|
142
|
-
values.to_dict(),
|
143
|
-
index,
|
144
|
-
)
|
145
|
-
)
|
146
|
-
return audformat.utils.concat(dfs)
|
147
|
-
|
148
|
-
|
149
119
|
if __name__ == "__main__":
|
150
120
|
main() # use this if you want to state the config file path on command line
|
@@ -32,8 +32,30 @@ class Silero_segmenter:
|
|
32
32
|
self.no_testing = not_testing
|
33
33
|
self.util = Util(has_config=not_testing)
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def get_segmentation_simple(self, file):
|
36
|
+
(
|
37
|
+
get_speech_timestamps,
|
38
|
+
save_audio,
|
39
|
+
read_audio,
|
40
|
+
VADIterator,
|
41
|
+
collect_chunks,
|
42
|
+
) = vad_utils
|
43
|
+
SAMPLING_RATE = 16000
|
44
|
+
wav = read_audio(file[0], sampling_rate=SAMPLING_RATE)
|
45
|
+
speech_timestamps = get_speech_timestamps(
|
46
|
+
wav, vad_model, sampling_rate=SAMPLING_RATE
|
47
|
+
)
|
48
|
+
files, starts, ends = [], [], []
|
49
|
+
for entry in speech_timestamps:
|
50
|
+
start = float(entry["start"] / SAMPLING_RATE)
|
51
|
+
end = float(entry["end"] / SAMPLING_RATE)
|
52
|
+
files.append(file[0])
|
53
|
+
starts.append(start)
|
54
|
+
ends.append(end)
|
55
|
+
seg_index = segmented_index(files, starts, ends)
|
56
|
+
return seg_index
|
57
|
+
|
58
|
+
def get_segmentation(self, file, min_length, max_length):
|
37
59
|
(
|
38
60
|
get_speech_timestamps,
|
39
61
|
save_audio,
|
@@ -42,12 +64,6 @@ class Silero_segmenter:
|
|
42
64
|
collect_chunks,
|
43
65
|
) = vad_utils
|
44
66
|
SAMPLING_RATE = 16000
|
45
|
-
if self.no_testing:
|
46
|
-
min_length = float(self.util.config_val("SEGMENT", "min_length", 2))
|
47
|
-
max_length = float(self.util.config_val("SEGMENT", "max_length", 10))
|
48
|
-
else:
|
49
|
-
min_length = 2
|
50
|
-
max_length = 10
|
51
67
|
wav = read_audio(file[0], sampling_rate=SAMPLING_RATE)
|
52
68
|
speech_timestamps = get_speech_timestamps(
|
53
69
|
wav, vad_model, sampling_rate=SAMPLING_RATE
|
@@ -76,8 +92,18 @@ class Silero_segmenter:
|
|
76
92
|
|
77
93
|
def segment_dataframe(self, df):
|
78
94
|
dfs = []
|
95
|
+
max_length = eval(self.util.config_val("SEGMENT", "max_length", "False"))
|
96
|
+
if max_length:
|
97
|
+
if self.no_testing:
|
98
|
+
min_length = float(self.util.config_val("SEGMENT", "min_length", 2))
|
99
|
+
else:
|
100
|
+
min_length = 2
|
101
|
+
self.util.debug(f"segmenting with max length: {max_length+min_length}")
|
79
102
|
for file, values in tqdm(df.iterrows()):
|
80
|
-
|
103
|
+
if max_length:
|
104
|
+
index = self.get_segmentation(file, min_length, max_length)
|
105
|
+
else:
|
106
|
+
index = self.get_segmentation_simple(file)
|
81
107
|
dfs.append(
|
82
108
|
pd.DataFrame(
|
83
109
|
values.to_dict(),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nkululeko
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.91.0
|
4
4
|
Summary: Machine learning audio prediction experiments based on templates
|
5
5
|
Home-page: https://github.com/felixbur/nkululeko
|
6
6
|
Author: Felix Burkhardt
|
@@ -356,6 +356,15 @@ F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schulle
|
|
356
356
|
Changelog
|
357
357
|
=========
|
358
358
|
|
359
|
+
Version 0.91.0
|
360
|
+
--------------
|
361
|
+
* fixed duration display in segmentation
|
362
|
+
* added possibility to use original segmentations (without max. duration)
|
363
|
+
|
364
|
+
Version 0.90.4
|
365
|
+
--------------
|
366
|
+
* added plot format for multidb
|
367
|
+
|
359
368
|
Version 0.90.3
|
360
369
|
--------------
|
361
370
|
* refactorings and documentations
|
@@ -2,7 +2,7 @@ nkululeko/__init__.py,sha256=62f8HiEzJ8rG2QlTFJXUCMpvuH3fKI33DoJSj33mscc,63
|
|
2
2
|
nkululeko/aug_train.py,sha256=FoMbBrfyOZd4QAw7oIHl3X6-UpsqAKWVDIolCA7qOWs,3196
|
3
3
|
nkululeko/augment.py,sha256=3RzaxB3gRxovgJVjHXi0glprW01J7RaHhUkqotW2T3U,2955
|
4
4
|
nkululeko/cacheddataset.py,sha256=XFpWZmbJRg0pvhnIgYf0TkclxllD-Fctu-Ol0PF_00c,969
|
5
|
-
nkululeko/constants.py,sha256
|
5
|
+
nkululeko/constants.py,sha256=-UMUKbVCG7HZtHGjf1N3s2BVchQTrro_MuNxqPUHr3Q,39
|
6
6
|
nkululeko/demo-ft.py,sha256=iD9Pzp9QjyAv31q1cDZ75vPez7Ve8A4Cfukv5yfZdrQ,770
|
7
7
|
nkululeko/demo.py,sha256=4Yzhg6pCPBYPGJrP7JX2TysVosl_R1llpVDKc2P_gUA,4955
|
8
8
|
nkululeko/demo_feats.py,sha256=BvZjeNFTlERIRlq34OHM4Z96jdDQAhB01BGQAUcX9dM,2026
|
@@ -17,7 +17,7 @@ nkululeko/filter_data.py,sha256=5AYDtqs_GWGr4V5CbbYQkVVgCD3kq2dpKu8rF3V87NI,7224
|
|
17
17
|
nkululeko/fixedsegment.py,sha256=Tb92QiuiyMsOO3WRWwuGjZGibS8hbHHCrcWAXGk7g04,2868
|
18
18
|
nkululeko/glob_conf.py,sha256=KL9YJQTHvTztxo1vr25qRRgaPnx4NTg0XrdbovKGMmw,525
|
19
19
|
nkululeko/modelrunner.py,sha256=lJy-xM4QfDDWeL0dLTE_VIb4sYrnd_Z_yJRK3wwohQA,11199
|
20
|
-
nkululeko/multidb.py,sha256=
|
20
|
+
nkululeko/multidb.py,sha256=sO6OwJn8sn1-C-ig3thsIL8QMWHdV9SnJhDodKjeKrI,6876
|
21
21
|
nkululeko/nkuluflag.py,sha256=PGWSmZz-PiiHLgcZJAoGOI_Y-sZDVI1ksB8p5r7riWM,3725
|
22
22
|
nkululeko/nkululeko.py,sha256=M7baIq2nAoi6dEoBL4ATEuqAs5U1fvl_hyqAl5DybAQ,2040
|
23
23
|
nkululeko/plots.py,sha256=p9YyN-xAtdGBKjcA305V0KOagAzG8VG6D_Ceoa9rae4,22964
|
@@ -25,7 +25,7 @@ nkululeko/predict.py,sha256=b35YOqovGb5PLDz0nDuhJGykEAPq2Y45R9lzxJZMuMU,2083
|
|
25
25
|
nkululeko/resample.py,sha256=akSAjJ3qn-O5NAyLJHVHdsK7MUZPGaZUvM2TwMSmj2M,5194
|
26
26
|
nkululeko/runmanager.py,sha256=AswmORVUkCIH0gTx6zEyufvFATQBS8C5TXo2erSNdVg,7611
|
27
27
|
nkululeko/scaler.py,sha256=7VOZ4sREMoQtahfETt9RyuR29Fb7PCwxlYVjBbdCVFc,4101
|
28
|
-
nkululeko/segment.py,sha256=
|
28
|
+
nkululeko/segment.py,sha256=5yJ3QpdAfw-lecWNiEC94iHIyC2j8FV7hjP3OmrNrYs,3784
|
29
29
|
nkululeko/syllable_nuclei.py,sha256=5w_naKxNxz66a_qLkraemi2fggM-gWesiiBPS47iFcE,9931
|
30
30
|
nkululeko/test.py,sha256=1w624vo5KTzmFC8BUStGlLDmIEAFuJUz7J0W-gp7AxI,1677
|
31
31
|
nkululeko/test_predictor.py,sha256=DEHE_D3A6m6KJTrpDKceA1n655t_UZV3WQd57K4a3Ho,2863
|
@@ -105,14 +105,14 @@ nkululeko/reporting/reporter.py,sha256=4OlYZAParkfJKO_aAyxqVpLc21zxZ-jDhtJKIMeUs
|
|
105
105
|
nkululeko/reporting/result.py,sha256=G63a2tHCwHhM6NBJgYzsWKWJm4Yu3r4hsCHA2Km7eHU,1073
|
106
106
|
nkululeko/segmenting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
107
|
nkululeko/segmenting/seg_inaspeechsegmenter.py,sha256=b3t0zdpJYofKWMyKRMtMMX91xeR-k8d5pbnNaQHcsOE,1902
|
108
|
-
nkululeko/segmenting/seg_silero.py,sha256=
|
108
|
+
nkululeko/segmenting/seg_silero.py,sha256=ulodnvtRq5MLHDxy_RmAK4tJg6h1d-mPq-uCPFkGVKg,4258
|
109
109
|
nkululeko/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
110
110
|
nkululeko/utils/files.py,sha256=UiGAtZRWYjHSvlmPaTMtzyNNGE6qaLaxQkybctS7iRM,4021
|
111
111
|
nkululeko/utils/stats.py,sha256=vCRzhCR0Gx5SiJyAGbj1TIto8ocGz58CM5Pr3LltagA,2948
|
112
112
|
nkululeko/utils/util.py,sha256=XFZdhCc_LM4EmoZ5tKKaBCQLXclcNmvHwhfT_CXB98c,16723
|
113
|
-
nkululeko-0.
|
114
|
-
nkululeko-0.
|
115
|
-
nkululeko-0.
|
116
|
-
nkululeko-0.
|
117
|
-
nkululeko-0.
|
118
|
-
nkululeko-0.
|
113
|
+
nkululeko-0.91.0.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
|
114
|
+
nkululeko-0.91.0.dist-info/METADATA,sha256=Mm26CeymZjX8L2fOThZXWM6M-my4u45hQ4aFPfDdyzc,41388
|
115
|
+
nkululeko-0.91.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
116
|
+
nkululeko-0.91.0.dist-info/entry_points.txt,sha256=KpQhz4HKBvYLrNooqLIc83hub76axRbYUgWzYkH3GnU,397
|
117
|
+
nkululeko-0.91.0.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
|
118
|
+
nkululeko-0.91.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|