Skip to content

Instantly share code, notes, and snippets.

View faroit's full-sized avatar
🚀
Rocket Science

Fabian-Robert Stöter faroit

🚀
Rocket Science
View GitHub Profile
@faroit
faroit / alpha_stable_noise_movie.py
Last active August 23, 2021 07:17
alpha stable noise
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')
@faroit
faroit / Dockerfile
Created July 26, 2019 20:18
torchaudio installation using using only conda
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
@faroit
faroit / pescador_sampling.py
Created July 18, 2019 15:26
Using pescador to sample random chunks from spectrograms (saved as npy matrices)
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
import numpy as np
import pescador
import torch.utils.data
np.random.seed(42)
nb_tracks = 100
track_length = 30
excerpt_length = 10
@faroit
faroit / count.py
Last active June 16, 2017 12:05
Count audio track duration
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()
@faroit
faroit / 32ch_chromium.patch
Last active March 19, 2017 16:19
Add more than 8 channel support to chromium
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(-)
@faroit
faroit / keras_generator.py
Created March 19, 2017 00:43
threadsafe_generator
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/
@faroit
faroit / pairwise.md
Created October 11, 2016 21:35
pairwise distance comparisons

PYTHON

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')
@faroit
faroit / .tmux.conf
Last active March 12, 2020 21:59
tmux conf
# Usage:
# - Prefix is set to Ctrl-a (make sure you remapped Caps Lock to Ctrl)
# - All prefixed with Ctrl-a
# - Last used window: /
# - Last used pane: ;
# - Vertical split: v
# - Horizontal split: s
# - Previous window: [
# - Next window: ]
# - Choose session: Ctrl-s

Keybase proof

I hereby claim:

  • I am faroit on github.
  • I am faroit (https://keybase.io/faroit) on keybase.
  • I have a public key whose fingerprint is 1A86 8B44 A8FF C682 94D9 F729 DB01 E2B2 0DB1 9CC3

To claim this, I am signing this object: