This file contains 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 itertools | |
import os | |
import shutil | |
import soundfile as sf | |
import librosa | |
import librosa.beat | |
import librosa.effects | |
beat = 4 |
This file contains 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 xdg-open | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Terminal=false | |
Exec=/usr/bin/gnome-terminal -- ssh atlantica | |
Name=SSH | |
Comment=SSH |
This file contains 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 cv2 | |
import numpy as np | |
def nlmeans(i, o, h=10, hColor=10, templateWindowSize=9, searchWindowSize=27): | |
img = cv2.imdecode(np.frombuffer(open(i, "rb").read(), np.uint8), cv2.IMREAD_COLOR | cv2.IMREAD_ANYDEPTH) | |
denoised = cv2.fastNlMeansDenoisingColored(img, h=h, hColor=hColor, templateWindowSize=templateWindowSize, searchWindowSize=searchWindowSize) | |
ok, bin = cv2.imencode(".png", denoised, [cv2.IMWRITE_PNG_COMPRESSION, 9]) | |
assert ok | |
open(o, "wb").write(bin.tobytes()) |
This file contains 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 cv2 | |
import numpy as np | |
def bilateral(i, o, d=7, sigmaColor=32, sigmaSpace=10): | |
img = cv2.imdecode(np.frombuffer(open(i, "rb").read(), np.uint8), cv2.IMREAD_COLOR | cv2.IMREAD_ANYDEPTH) | |
denoised = cv2.bilateralFilter(img, d=d, sigmaColor=sigmaColor, sigmaSpace=sigmaSpace) | |
ok, bin = cv2.imencode(".png", denoised, [cv2.IMWRITE_PNG_COMPRESSION, 9]) | |
assert ok | |
open(o, "wb").write(bin.tobytes()) |
This file contains 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 python3 | |
import sys | |
import os | |
from pathlib import Path | |
from collections import Counter | |
def eprint(*args, **kwargs): | |
print(*args, file=sys.stderr, **kwargs) |
This file contains 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 functools | |
def once(func): | |
fst = True | |
result = None | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
nonlocal fst, result | |
if fst: |
This file contains 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 | |
large_arr = np.random.normal(size=(3, 10000, 10000)).astype("float64") | |
np.save("example.npy", large_arr) | |
import time | |
import random | |
from numpy.lib.format import open_memmap |
This file contains 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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import numpy as np | |
def lanczos(x, n): | |
return 0.0 if abs(x) > n else np.sinc(x) * np.sinc(x / n) | |
class Lanczos2xUpsampler(nn.Module): | |
def __init__(self, n=3): |
This file contains 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 python3 | |
x = 3 | |
y = 2 | |
background = "white" | |
gap = 10 | |
duration = 100 | |
anims = [ | |
"APNGs/a1.png", | |
"APNGs/a2.png", |
This file contains 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
[Unit] | |
Description=AutoSSH | |
After=network.target | |
[Service] | |
User=pi | |
Group=pi | |
Type=simple | |
ExecStart=/usr/bin/autossh vps -N -R 8000:10.10.10.10:3389 | |
KillSignal=SIGQUIT |
NewerOlder