running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
def lengths_to_mask(lengths, max_len=None, dtype=None): | |
""" | |
Converts a "lengths" tensor to its binary mask representation. | |
Based on: https://discuss.pytorch.org/t/how-to-generate-variable-length-mask/23397 |
package main | |
import ( | |
"log" | |
"os" | |
gst "github.com/spreadspace/go-gstreamer" | |
"github.com/ziutek/glib" | |
) |
conda uninstall --force pillow -y | |
# install libjpeg-turbo to $HOME/turbojpeg | |
git clone https://github.com/libjpeg-turbo/libjpeg-turbo | |
pushd libjpeg-turbo | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg | |
make | |
make install |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
""" | |
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. |
# variation to https://github.com/ryankiros/skip-thoughts/blob/master/decoding/search.py | |
def keras_rnn_predict(samples, empty=empty, rnn_model=model, maxlen=maxlen): | |
"""for every sample, calculate probability for every possible label | |
you need to supply your RNN model and maxlen - the length of sequences it can handle | |
""" | |
data = sequence.pad_sequences(samples, maxlen=maxlen, value=empty) | |
return rnn_model.predict(data, verbose=0) | |
def beamsearch(predict=keras_rnn_predict, |
<form id="contact-form" action="//formspree.io/your@email.com" method="post"> | |
<input type="text" name="Name" placeholder="Name" required> | |
<input type="email" name="Email" placeholder="Email" required> | |
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea> | |
<!-- CONFIG --> | |
<input class="is-hidden" type="text" name="_gotcha"> | |
<input type="hidden" name="_subject" value="Subject"> | |
<input type="hidden" name="_cc" value="email@cc.com"> | |
<!-- /CONFIG --> | |
<input class="submit" type="submit" value="Send"> |
def sliding_window(data, size, stepsize=1, padded=False, axis=-1, copy=True): | |
""" | |
Calculate a sliding window over a signal | |
Parameters | |
---------- | |
data : numpy array | |
The array to be slided over. | |
size : int | |
The sliding window size |
This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.
This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)
Make sure you have the latest version of XCode installed. Available from the Mac App Store.
Install the Xcode Command Line Tools:
xcode-select --install
# Example for my blog post at: | |
# http://danijar.com/introduction-to-recurrent-networks-in-tensorflow/ | |
import functools | |
import sets | |
import tensorflow as tf | |
def lazy_property(function): | |
attribute = '_' + function.__name__ |