This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import scipy.linalg | |
| import scipy.stats | |
| def ks_key(X): | |
| '''Estimate the key from a pitch class distribution | |
| Parameters | |
| ---------- | |
| X : np.ndarray, shape=(12,) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| '''Compute VGGish features for a batch of files''' | |
| import argparse | |
| import os | |
| import sys | |
| import librosa | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import librosa | |
| def load_audio(filename, **kwargs): | |
| y, sr = librosa.load(filename, sr=22050, mono=True, **kwargs) | |
| y = librosa.util.normalize(y) * 256 | |
| return y[np.newaxis, :, np.newaxis] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [1]: import numpy as np | |
| In [2]: import json | |
| In [3]: json.dumps(np.float64(2.0)) | |
| Out[3]: '2.0' | |
| In [4]: json.dumps(np.float32(2.0)) | |
| --------------------------------------------------------------------------- | |
| TypeError Traceback (most recent call last) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.