Spaces:
Running
Running
Commit
·
75807c5
1
Parent(s):
e47e5af
Script fixes
Browse files
app.py
CHANGED
@@ -82,8 +82,7 @@ class AudioFeature:
|
|
82 |
self.y = None
|
83 |
self.y_harm, self.y_perc = None, None
|
84 |
|
85 |
-
def detect_key(self, chroma_vals: np.ndarray)
|
86 |
-
"""Detect the key and mode (major or minor) of the audio segment."""
|
87 |
note_names = ['C', 'C#', 'D', 'D#', 'E',
|
88 |
'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
|
89 |
major_profile = np.array(
|
@@ -225,7 +224,7 @@ def positional_encoding(position: int, d_model: int) -> np.ndarray:
|
|
225 |
return np.concatenate([np.sin(angle_rads[:, 0::2]), np.cos(angle_rads[:, 1::2])], axis=-1)
|
226 |
|
227 |
|
228 |
-
def apply_hierarchical_positional_encoding(segments
|
229 |
"""Apply positional encoding at the meter and frame levels to a list of segments."""
|
230 |
n_features = segments[0].shape[1]
|
231 |
measure_level_encodings = positional_encoding(len(segments), n_features)
|
|
|
82 |
self.y = None
|
83 |
self.y_harm, self.y_perc = None, None
|
84 |
|
85 |
+
def detect_key(self, chroma_vals: np.ndarray):
|
|
|
86 |
note_names = ['C', 'C#', 'D', 'D#', 'E',
|
87 |
'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
|
88 |
major_profile = np.array(
|
|
|
224 |
return np.concatenate([np.sin(angle_rads[:, 0::2]), np.cos(angle_rads[:, 1::2])], axis=-1)
|
225 |
|
226 |
|
227 |
+
def apply_hierarchical_positional_encoding(segments):
|
228 |
"""Apply positional encoding at the meter and frame levels to a list of segments."""
|
229 |
n_features = segments[0].shape[1]
|
230 |
measure_level_encodings = positional_encoding(len(segments), n_features)
|