nkululeko 0.95.1__py3-none-any.whl → 0.95.2__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/feat_extract/feats_mld.py +13 -5
- nkululeko/feature_extractor.py +5 -0
- nkululeko/optim.py +931 -0
- nkululeko/tests/test_optim.py +200 -0
- nkululeko-0.95.2.dist-info/METADATA +376 -0
- {nkululeko-0.95.1.dist-info → nkululeko-0.95.2.dist-info}/RECORD +11 -9
- nkululeko-0.95.1.dist-info/METADATA +0 -76
- {nkululeko-0.95.1.dist-info → nkululeko-0.95.2.dist-info}/WHEEL +0 -0
- {nkululeko-0.95.1.dist-info → nkululeko-0.95.2.dist-info}/entry_points.txt +0 -0
- {nkululeko-0.95.1.dist-info → nkululeko-0.95.2.dist-info}/licenses/LICENSE +0 -0
- {nkululeko-0.95.1.dist-info → nkululeko-0.95.2.dist-info}/top_level.txt +0 -0
nkululeko/constants.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
VERSION="0.95.
|
1
|
+
VERSION="0.95.2"
|
2
2
|
SAMPLING_RATE = 16000
|
@@ -1,15 +1,23 @@
|
|
1
1
|
# mld_fset.py
|
2
2
|
import os
|
3
3
|
import sys
|
4
|
+
from typing import Optional, Union, List, Any, Dict
|
4
5
|
|
5
6
|
import nkululeko.glob_conf as glob_conf
|
6
7
|
from nkululeko.feat_extract.featureset import Featureset
|
7
8
|
|
8
9
|
|
9
10
|
class MLD_set(Featureset):
|
10
|
-
def __init__(
|
11
|
-
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
name,
|
14
|
+
data_df,
|
15
|
+
feats_type: Optional[str] = None,
|
16
|
+
):
|
17
|
+
super().__init__(name, data_df, feats_type)
|
12
18
|
mld_path = self.util.config_val("FEATS", "mld.model", None)
|
19
|
+
if mld_path is None:
|
20
|
+
self.util.error("FEATS.mld.model required")
|
13
21
|
sys.path.append(mld_path)
|
14
22
|
|
15
23
|
def extract(self):
|
@@ -24,10 +32,10 @@ class MLD_set(Featureset):
|
|
24
32
|
)
|
25
33
|
else:
|
26
34
|
self.util.debug("reusing previously extracted midleveldescriptor features")
|
27
|
-
import
|
35
|
+
import audmld
|
28
36
|
|
29
|
-
fex_mld =
|
30
|
-
self.df = fex_mld.
|
37
|
+
fex_mld = audmld.Mld(num_workers=6, verbose=True)
|
38
|
+
self.df = fex_mld.process_index(index=self.data_df.index, cache_root=storage)
|
31
39
|
self.util.debug(f"MLD feats shape: {self.df.shape}")
|
32
40
|
# shouldn't happen
|
33
41
|
# replace NANa with column means values
|
nkululeko/feature_extractor.py
CHANGED
@@ -74,6 +74,11 @@ class FeatureExtractor:
|
|
74
74
|
|
75
75
|
return TRILLset
|
76
76
|
|
77
|
+
elif feats_type == "mld":
|
78
|
+
from nkululeko.feat_extract.feats_mld import MLD_set
|
79
|
+
|
80
|
+
return MLD_set
|
81
|
+
|
77
82
|
elif feats_type.startswith(
|
78
83
|
("wav2vec2", "hubert", "wavlm", "spkrec", "whisper", "ast", "emotion2vec")
|
79
84
|
):
|