start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
''' | |
_______ ______ | |
|_ _\ \ / / ___| | |
| | \ \ / /\___ \ | |
| | \ V / ___) | | |
|_| \_/ |____/ | |
Teske Virtual System |
ffmpeg -i <infile> -ac 2 -f wav <outfile> |
from scipy.io.wavfile import read, write | |
import io | |
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a | |
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some websocket or | |
## HTTP Post request. This should obviously work with any other sound format, as long as you have the proper decoding function | |
with open("input_wav.wav", "rb") as wavfile: | |
input_wav = wavfile.read() |
def argmax1(array): | |
return array.index(max(array)) | |
def argmax2(array): | |
return max(range(len(array)), key=lambda x: array[x]) |
import cv2 | |
import sys | |
import os | |
class FaceCropper(object): | |
CASCADE_PATH = "data/haarcascades/haarcascade_frontalface_default.xml" | |
def __init__(self): | |
self.face_cascade = cv2.CascadeClassifier(self.CASCADE_PATH) |
from graphviz import Digraph | |
from torch.autograd import Variable | |
import torch | |
def make_dot(var, params=None): | |
if params is not None: | |
assert isinstance(params.values()[0], Variable) | |
param_map = {id(v): k for k, v in params.items()} |
""" | |
Author: Awni Hannun | |
This is an example CTC decoder written in Python. The code is | |
intended to be a simple example and is not designed to be | |
especially efficient. | |
The algorithm is a prefix beam search for a model trained | |
with the CTC loss function. |