import scipy.spatial.distance as dist
import numpy as np
import timeit
X = np.random.random((1000, 1000))
def run():
c = dist.cdist(X, X, 'euclidean')
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 -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.9,<3.12" | |
| # dependencies = [ | |
| # "torch>=2.0,<2.2", | |
| # "torchaudio>=2.0,<2.2", | |
| # "deepfilternet==0.5.6", | |
| # "numpy<2", | |
| # "soundfile", | |
| # ] |
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
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "mlx-audio", | |
| # "numpy", | |
| # "pyqtgraph", | |
| # "PyQt6", | |
| # "sounddevice", | |
| # ] | |
| # /// |
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 matplotlib.animation as animation | |
| import matplotlib.pyplot as plt | |
| from collections import deque | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| from matplotlib.animation import FuncAnimation | |
| import scipy.stats | |
| plt.style.use('seaborn-pastel') |
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
| FROM continuumio/miniconda3 | |
| RUN apt-get update | |
| RUN apt-get install -y gcc build-essential g++ | |
| RUN conda install -c conda-forge sox | |
| RUN conda install -c pytorch pytorch | |
| RUN git clone https://github.com/pytorch/audio.git | |
| RUN cd audio && python setup.py install |
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 data | |
| import pescador | |
| import random | |
| def excerpt_generator( | |
| dataset, idx, | |
| ex_length=100, ex_hop=100, | |
| shuffle=True, rnd_ex=False, seed=42 |
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 pescador | |
| import torch.utils.data | |
| np.random.seed(42) | |
| nb_tracks = 100 | |
| track_length = 30 | |
| excerpt_length = 10 |
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 soundfile as sf | |
| import argparse | |
| import numpy as np | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser(description='Count duration of input files') | |
| parser.add_argument('inputs', nargs='+', help='input file names') | |
| args = parser.parse_args() |
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
| From 40b2c9fb9e3104f437d9f9d420f48e456c788c92 Mon Sep 17 00:00:00 2001 | |
| From: Fabian-Robert Stoeter <mail@faroit.com> | |
| Date: Fri, 17 Mar 2017 12:17:46 +0100 | |
| Subject: [PATCH] add support for more than 8channels | |
| --- | |
| media/base/channel_layout.cc | 10 ++++++++-- | |
| media/base/channel_layout.h | 2 +- | |
| 2 files changed, 9 insertions(+), 3 deletions(-) |
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 threading | |
| def threadsafe_generator(lock=None): | |
| def wrap(f): | |
| """A decorator that takes a generator function and makes it thread-safe. | |
| Taken from | |
| http://anandology.com/blog/using-iterators-and-generators/ |
NewerOlder