nkululeko 0.60.0__tar.gz → 0.61.0__tar.gz
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-0.60.0 → nkululeko-0.61.0}/CHANGELOG.md +4 -0
- {nkululeko-0.60.0/nkululeko.egg-info → nkululeko-0.61.0}/PKG-INFO +5 -1
- nkululeko-0.61.0/nkululeko/constants.py +1 -0
- nkululeko-0.61.0/nkululeko/feature_extractor.py +138 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/plots.py +11 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/segment.py +23 -27
- {nkululeko-0.60.0 → nkululeko-0.61.0/nkululeko.egg-info}/PKG-INFO +5 -1
- nkululeko-0.60.0/nkululeko/constants.py +0 -1
- nkululeko-0.60.0/nkululeko/feature_extractor.py +0 -95
- {nkululeko-0.60.0 → nkululeko-0.61.0}/LICENSE +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/README.md +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/__init__.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/augment.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/balancer.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/cacheddataset.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/demo.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/demo_predictor.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/experiment.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/explore.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/file_checker.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/filter_data.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/glob_conf.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/modelrunner.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/nkululeko.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/predict.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/reporter.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/result.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/runmanager.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/scaler.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/syllable_nuclei.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/test.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/test_predictor.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko/util.py +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko.egg-info/SOURCES.txt +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko.egg-info/dependency_links.txt +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko.egg-info/requires.txt +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/nkululeko.egg-info/top_level.txt +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/pyproject.toml +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/setup.cfg +0 -0
- {nkululeko-0.60.0 → nkululeko-0.61.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nkululeko
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.61.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
|
@@ -228,6 +228,10 @@ Nkululeko can be used under the [MIT license](https://choosealicense.com/license
|
|
228
228
|
Changelog
|
229
229
|
=========
|
230
230
|
|
231
|
+
Version 0.61.0
|
232
|
+
--------------
|
233
|
+
* added HUBERT embeddings
|
234
|
+
|
231
235
|
Version 0.60.0
|
232
236
|
--------------
|
233
237
|
* some bugfixes
|
@@ -0,0 +1 @@
|
|
1
|
+
VERSION = '0.61.0'
|
@@ -0,0 +1,138 @@
|
|
1
|
+
"""
|
2
|
+
feature_extractor.py
|
3
|
+
|
4
|
+
Helper class to encapsulate feature extraction methods
|
5
|
+
|
6
|
+
"""
|
7
|
+
import pandas as pd
|
8
|
+
|
9
|
+
from nkululeko.feat_extract.feats_opensmile import Opensmileset
|
10
|
+
from nkululeko.util import Util
|
11
|
+
|
12
|
+
|
13
|
+
class FeatureExtractor:
|
14
|
+
"""
|
15
|
+
Extract acoustic features from audio samples, using several feature extractors (appends the features column-wise)
|
16
|
+
Args:
|
17
|
+
data_df (pandas.DataFrame): dataframe with audiofile paths as index
|
18
|
+
feats_types (array of strings): designations of acoustic feature extractors to be used
|
19
|
+
data_name (string): names of databases that are extracted (for the caching)
|
20
|
+
feats_designation (string): the type of split (train/test), also is used for the cache name.
|
21
|
+
Returns:
|
22
|
+
df (pandas.DataFrame): dataframe with same index as data_df and acoustic features in columns
|
23
|
+
"""
|
24
|
+
|
25
|
+
# pandas dataframe to store the features (and indexed with the data from the sets)
|
26
|
+
df = None
|
27
|
+
data_df = None # dataframe to get audio paths
|
28
|
+
|
29
|
+
# def __init__
|
30
|
+
def __init__(self, data_df, feats_types, data_name, feats_designation):
|
31
|
+
self.data_df = data_df
|
32
|
+
self.data_name = data_name
|
33
|
+
self.feats_types = feats_types
|
34
|
+
self.util = Util("feature_extractor")
|
35
|
+
self.feats_designation = feats_designation
|
36
|
+
|
37
|
+
def extract(self):
|
38
|
+
# feats_types = self.util.config_val_list('FEATS', 'type', ['os'])
|
39
|
+
self.featExtractor = None
|
40
|
+
self.feats = pd.DataFrame()
|
41
|
+
_scale = True
|
42
|
+
for feats_type in self.feats_types:
|
43
|
+
store_name = f"{self.data_name}_{feats_type}"
|
44
|
+
if feats_type == "os":
|
45
|
+
self.featExtractor = Opensmileset(
|
46
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
47
|
+
)
|
48
|
+
elif feats_type == "trill":
|
49
|
+
from nkululeko.feat_extract.feats_trill import TRILLset
|
50
|
+
self.featExtractor = TRILLset(
|
51
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
52
|
+
)
|
53
|
+
elif feats_type == "wav2vec":
|
54
|
+
from nkululeko.feat_extract.feats_wav2vec2 import Wav2vec2
|
55
|
+
self.featExtractor = Wav2vec2(
|
56
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
57
|
+
)
|
58
|
+
elif feats_type in ("hubert", "hubert_ft", "hubert_large",
|
59
|
+
"hubert_xlarge", "hubert_xlarge_ft"):
|
60
|
+
from nkululeko.feat_extract.feats_hubert import Hubert
|
61
|
+
self.featExtractor = Hubert(
|
62
|
+
f"{store_name}_{self.feats_designation}", self.data_df,
|
63
|
+
feats_type
|
64
|
+
)
|
65
|
+
|
66
|
+
elif feats_type == "audmodel":
|
67
|
+
from nkululeko.feat_extract.feats_audmodel import AudModelSet
|
68
|
+
self.featExtractor = AudModelSet(
|
69
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
70
|
+
)
|
71
|
+
elif feats_type == "auddim":
|
72
|
+
from nkululeko.feat_extract.feats_audmodel_dim import \
|
73
|
+
AudModelDimSet
|
74
|
+
self.featExtractor = AudModelDimSet(
|
75
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
76
|
+
)
|
77
|
+
elif feats_type == "agender":
|
78
|
+
from nkululeko.feat_extract.feats_agender import \
|
79
|
+
AudModelAgenderSet
|
80
|
+
self.featExtractor = AudModelAgenderSet(
|
81
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
82
|
+
)
|
83
|
+
elif feats_type == "agender_agender":
|
84
|
+
from nkululeko.feat_extract.feats_agender_agender import \
|
85
|
+
AgenderAgenderSet
|
86
|
+
self.featExtractor = AgenderAgenderSet(
|
87
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
88
|
+
)
|
89
|
+
elif feats_type == "snr":
|
90
|
+
from nkululeko.feat_extract.feats_snr import SNRSet
|
91
|
+
self.featExtractor = SNRSet(
|
92
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
93
|
+
)
|
94
|
+
elif feats_type == "mos":
|
95
|
+
from nkululeko.feat_extract.feats_mos import MOSSet
|
96
|
+
self.featExtractor = MOSSet(
|
97
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
98
|
+
)
|
99
|
+
elif feats_type == "squim":
|
100
|
+
from nkululeko.feat_extract.feats_squim import SQUIMSet
|
101
|
+
self.featExtractor = SQUIMSet(
|
102
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
103
|
+
)
|
104
|
+
elif feats_type == "clap":
|
105
|
+
from nkululeko.feat_extract.feats_clap import Clap
|
106
|
+
self.featExtractor = Clap(
|
107
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
108
|
+
)
|
109
|
+
elif feats_type == "praat":
|
110
|
+
from nkululeko.feat_extract.feats_praat import Praatset
|
111
|
+
self.featExtractor = Praatset(
|
112
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
113
|
+
)
|
114
|
+
elif feats_type == "mld":
|
115
|
+
from nkululeko.feat_extract.feats_mld import MLD_set
|
116
|
+
self.featExtractor = MLD_set(
|
117
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
118
|
+
)
|
119
|
+
elif feats_type == "import":
|
120
|
+
from nkululeko.feat_extract.feats_import import Importset
|
121
|
+
self.featExtractor = Importset(
|
122
|
+
f"{store_name}_{self.feats_designation}", self.data_df
|
123
|
+
)
|
124
|
+
else:
|
125
|
+
self.util.error(f"unknown feats_type: {feats_type}")
|
126
|
+
|
127
|
+
self.featExtractor.extract()
|
128
|
+
self.featExtractor.filter()
|
129
|
+
# remove samples that were not extracted by MLD
|
130
|
+
# self.df_test = self.df_test.loc[self.df_test.index.intersection(featExtractor_test.df.index)]
|
131
|
+
# self.df_train = self.df_train.loc[self.df_train.index.intersection(featExtractor_train.df.index)]
|
132
|
+
self.util.debug(
|
133
|
+
f"{feats_type}: shape : {self.featExtractor.df.shape}")
|
134
|
+
self.feats = pd.concat([self.feats, self.featExtractor.df], axis=1)
|
135
|
+
return self.feats
|
136
|
+
|
137
|
+
def extract_sample(self, signal, sr):
|
138
|
+
return self.featExtractor.extract_sample(signal, sr)
|
@@ -95,6 +95,17 @@ class Plots():
|
|
95
95
|
else:
|
96
96
|
self.util.error(f'plot value counts: the plot distribution descriptor for {att} has more than 2 values')
|
97
97
|
|
98
|
+
def plot_durations(self, df, filename, sample_selection):
|
99
|
+
fig_dir = self.util.get_path('fig_dir')+'../' # one up because of the runs
|
100
|
+
ax = sns.histplot(df, x='duration', hue='class_label', kde=True)
|
101
|
+
ax.set_title(f'{sample_selection} {df.shape[0]}')
|
102
|
+
ax.set_xlabel(f'duration')
|
103
|
+
ax.set_ylabel(f'number of samples')
|
104
|
+
fig = ax.figure
|
105
|
+
plt.tight_layout()
|
106
|
+
plt.savefig(f'{fig_dir}{filename}_{sample_selection}.{self.format}')
|
107
|
+
plt.close(fig)
|
108
|
+
fig.clear()
|
98
109
|
|
99
110
|
def describe_df(self, name, df, target, filename):
|
100
111
|
"""Make a stacked barplot of samples and speakers per sex and target values. speaker, gender and target columns must be present"""
|
@@ -7,25 +7,8 @@ from nkululeko.util import Util
|
|
7
7
|
from nkululeko.constants import VERSION
|
8
8
|
import argparse
|
9
9
|
import os
|
10
|
-
import torch
|
11
|
-
import audformat
|
12
|
-
from audformat.utils import to_filewise_index
|
13
|
-
from audformat import segmented_index
|
14
10
|
import pandas as pd
|
15
11
|
|
16
|
-
# initialize the VAD model
|
17
|
-
SAMPLING_RATE = 16000
|
18
|
-
torch.set_num_threads(1)
|
19
|
-
vad_model, vad_utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',
|
20
|
-
model='silero_vad',
|
21
|
-
force_reload=False,
|
22
|
-
onnx=False)
|
23
|
-
(get_speech_timestamps,
|
24
|
-
save_audio,
|
25
|
-
read_audio,
|
26
|
-
VADIterator,
|
27
|
-
collect_chunks) = vad_utils
|
28
|
-
|
29
12
|
def main(src_dir):
|
30
13
|
parser = argparse.ArgumentParser(description='Call the nkululeko framework.')
|
31
14
|
parser.add_argument('--config', default='exp.ini', help='The base configuration')
|
@@ -60,7 +43,7 @@ def main(src_dir):
|
|
60
43
|
util.debug(f'train shape : {expr.df_train.shape}, test shape:{expr.df_test.shape}')
|
61
44
|
|
62
45
|
# segment
|
63
|
-
segment_target = util.config_val('
|
46
|
+
segment_target = util.config_val('SEGMENT', 'target', '_seg')
|
64
47
|
# this if a specific dataset is to be segmented
|
65
48
|
# segment_db = util.config_val('DATA', 'segment', False)
|
66
49
|
# if segment_db:
|
@@ -72,7 +55,8 @@ def main(src_dir):
|
|
72
55
|
# name = f'{dataset}{segment_target}'
|
73
56
|
# df_seg.to_csv(f'{expr.data_dir}/{name}.csv')
|
74
57
|
|
75
|
-
|
58
|
+
segmenter = util.config_val('SEGMENT', 'method', 'silero')
|
59
|
+
sample_selection = util.config_val('SEGMENT', 'sample_selection', 'all')
|
76
60
|
if sample_selection=='all':
|
77
61
|
df = pd.concat([expr.df_train, expr.df_test])
|
78
62
|
elif sample_selection=='train':
|
@@ -81,26 +65,38 @@ def main(src_dir):
|
|
81
65
|
df = expr.df_test
|
82
66
|
else:
|
83
67
|
util.error(f'unknown segmentation selection specifier {sample_selection}, should be [all | train | test]')
|
68
|
+
# if "duration" not in df.columns:
|
69
|
+
# df = df.drop(columns=['duration'], inplace=True)
|
70
|
+
util.debug(f'segmenting {sample_selection}: {df.shape[0]} samples with {segmenter}')
|
71
|
+
if segmenter=='silero':
|
72
|
+
from nkululeko.segmenting.seg_silero import Silero_segmenter
|
73
|
+
segmenter = Silero_segmenter()
|
74
|
+
df_seg = segmenter.segment_dataframe(df)
|
75
|
+
|
76
|
+
else:
|
77
|
+
util.error(f'unkown segmenter: {segmenter}')
|
84
78
|
|
85
|
-
if "duration" not in df.columns:
|
86
|
-
df = df.drop(columns=['duration'], inplace=True)
|
87
|
-
util.debug(f'segmenting train and test set: {df.shape[0]} samples')
|
88
|
-
df_seg = segment_dataframe(df)
|
89
79
|
def calc_dur(x):
|
80
|
+
from datetime import datetime
|
90
81
|
starts = x[1]
|
91
82
|
ends = x[2]
|
92
83
|
return (ends - starts).total_seconds()
|
93
84
|
df_seg['duration'] = df_seg.index.to_series().map(lambda x:calc_dur(x))
|
85
|
+
if "duration" not in df.columns:
|
86
|
+
df['duration'] = df.index.to_series().map(lambda x:calc_dur(x))
|
87
|
+
num_before = df.shape[0]
|
88
|
+
num_after = df_seg.shape[0]
|
94
89
|
dataname = '_'.join(expr.datasets.keys())
|
95
90
|
name = f'{dataname}{segment_target}'
|
96
91
|
df_seg.to_csv(f'{expr.data_dir}/{name}.csv')
|
92
|
+
from nkululeko.plots import Plots
|
93
|
+
plots = Plots()
|
94
|
+
plots.plot_durations(df, 'original_durations', sample_selection)
|
95
|
+
plots.plot_durations(df_seg, 'segmented_durations', sample_selection)
|
97
96
|
print('')
|
98
|
-
util.debug(f'saved {name}.csv to {expr.data_dir}, {
|
97
|
+
util.debug(f'saved {name}.csv to {expr.data_dir}, {num_after} samples (was {num_before})')
|
99
98
|
print('DONE')
|
100
99
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
100
|
def get_segmentation(file):
|
105
101
|
# print(f'segmenting {file[0]}')
|
106
102
|
print('.', end='')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nkululeko
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.61.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
|
@@ -228,6 +228,10 @@ Nkululeko can be used under the [MIT license](https://choosealicense.com/license
|
|
228
228
|
Changelog
|
229
229
|
=========
|
230
230
|
|
231
|
+
Version 0.61.0
|
232
|
+
--------------
|
233
|
+
* added HUBERT embeddings
|
234
|
+
|
231
235
|
Version 0.60.0
|
232
236
|
--------------
|
233
237
|
* some bugfixes
|
@@ -1 +0,0 @@
|
|
1
|
-
VERSION = '0.60.0'
|
@@ -1,95 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
feature_extractor.py
|
3
|
-
|
4
|
-
Helper class to encapsulate feature extraction methods
|
5
|
-
|
6
|
-
"""
|
7
|
-
import pandas as pd
|
8
|
-
from nkululeko.util import Util
|
9
|
-
from nkululeko.feat_extract.feats_opensmile import Opensmileset
|
10
|
-
|
11
|
-
|
12
|
-
class FeatureExtractor:
|
13
|
-
"""
|
14
|
-
Extract acoustic features from audio samples, using several feature extractors (appends the features column-wise)
|
15
|
-
Args:
|
16
|
-
data_df (pandas.DataFrame): dataframe with audiofile paths as index
|
17
|
-
feats_types (array of strings): designations of acoustic feature extractors to be used
|
18
|
-
data_name (string): names of databases that are extracted (for the caching)
|
19
|
-
feats_designation (string): the type of split (train/test), also is used for the cache name.
|
20
|
-
Returns:
|
21
|
-
df (pandas.DataFrame): dataframe with same index as data_df and acoustic features in columns
|
22
|
-
"""
|
23
|
-
df = None # pandas dataframe to store the features (and indexed with the data from the sets)
|
24
|
-
data_df = None # dataframe to get audio paths
|
25
|
-
|
26
|
-
# def __init__
|
27
|
-
def __init__(self, data_df, feats_types, data_name, feats_designation):
|
28
|
-
self.data_df = data_df
|
29
|
-
self.data_name = data_name
|
30
|
-
self.feats_types = feats_types
|
31
|
-
self.util = Util('feature_extractor')
|
32
|
-
self.feats_designation = feats_designation
|
33
|
-
|
34
|
-
def extract(self):
|
35
|
-
# feats_types = self.util.config_val_list('FEATS', 'type', ['os'])
|
36
|
-
self.featExtractor = None
|
37
|
-
self.feats= pd.DataFrame()
|
38
|
-
_scale = True
|
39
|
-
for feats_type in self.feats_types:
|
40
|
-
store_name = f'{self.data_name}_{feats_type}'
|
41
|
-
if feats_type=='os':
|
42
|
-
self.featExtractor = Opensmileset(f'{store_name}_{self.feats_designation}', self.data_df)
|
43
|
-
elif feats_type=='trill':
|
44
|
-
from nkululeko.feat_extract.feats_trill import TRILLset
|
45
|
-
self.featExtractor = TRILLset(f'{store_name}_{self.feats_designation}', self.data_df)
|
46
|
-
elif feats_type=='wav2vec':
|
47
|
-
from nkululeko.feat_extract.feats_wav2vec2 import Wav2vec2
|
48
|
-
self.featExtractor = Wav2vec2(f'{store_name}_{self.feats_designation}', self.data_df)
|
49
|
-
elif feats_type=='audmodel':
|
50
|
-
from nkululeko.feat_extract.feats_audmodel import AudModelSet
|
51
|
-
self.featExtractor = AudModelSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
52
|
-
elif feats_type=='auddim':
|
53
|
-
from nkululeko.feat_extract.feats_audmodel_dim import AudModelDimSet
|
54
|
-
self.featExtractor = AudModelDimSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
55
|
-
elif feats_type=='agender':
|
56
|
-
from nkululeko.feat_extract.feats_agender import AudModelAgenderSet
|
57
|
-
self.featExtractor = AudModelAgenderSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
58
|
-
elif feats_type=='agender_agender':
|
59
|
-
from nkululeko.feat_extract.feats_agender_agender import AgenderAgenderSet
|
60
|
-
self.featExtractor = AgenderAgenderSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
61
|
-
elif feats_type=='snr':
|
62
|
-
from nkululeko.feat_extract.feats_snr import SNRSet
|
63
|
-
self.featExtractor = SNRSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
64
|
-
elif feats_type=='mos':
|
65
|
-
from nkululeko.feat_extract.feats_mos import MOSSet
|
66
|
-
self.featExtractor = MOSSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
67
|
-
elif feats_type=='squim':
|
68
|
-
from nkululeko.feat_extract.feats_squim import SQUIMSet
|
69
|
-
self.featExtractor = SQUIMSet(f'{store_name}_{self.feats_designation}', self.data_df)
|
70
|
-
elif feats_type=='clap':
|
71
|
-
from nkululeko.feat_extract.feats_clap import Clap
|
72
|
-
self.featExtractor = Clap(f'{store_name}_{self.feats_designation}', self.data_df)
|
73
|
-
elif feats_type=='praat':
|
74
|
-
from nkululeko.feat_extract.feats_praat import Praatset
|
75
|
-
self.featExtractor = Praatset(f'{store_name}_{self.feats_designation}', self.data_df)
|
76
|
-
elif feats_type=='mld':
|
77
|
-
from nkululeko.feat_extract.feats_mld import MLD_set
|
78
|
-
self.featExtractor = MLD_set(f'{store_name}_{self.feats_designation}', self.data_df)
|
79
|
-
elif feats_type=='import':
|
80
|
-
from nkululeko.feat_extract.feats_import import Importset
|
81
|
-
self.featExtractor = Importset(f'{store_name}_{self.feats_designation}', self.data_df)
|
82
|
-
else:
|
83
|
-
self.util.error(f'unknown feats_type: {feats_type}')
|
84
|
-
|
85
|
-
self.featExtractor.extract()
|
86
|
-
self.featExtractor.filter()
|
87
|
-
# remove samples that were not extracted by MLD
|
88
|
-
#self.df_test = self.df_test.loc[self.df_test.index.intersection(featExtractor_test.df.index)]
|
89
|
-
#self.df_train = self.df_train.loc[self.df_train.index.intersection(featExtractor_train.df.index)]
|
90
|
-
self.util.debug(f'{feats_type}: shape : {self.featExtractor.df.shape}')
|
91
|
-
self.feats = pd.concat([self.feats, self.featExtractor.df], axis = 1)
|
92
|
-
return self.feats
|
93
|
-
|
94
|
-
def extract_sample(self, signal, sr):
|
95
|
-
return self.featExtractor.extract_sample(signal, sr)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|