Skip to content

Instantly share code, notes, and snippets.

View dsuess's full-sized avatar
🤔
...

Daniel Suess dsuess

🤔
...
View GitHub Profile
@dsuess
dsuess / haar.py
Created April 11, 2017 11:56
Haar Distribution in PyMC3
def HaarDistribution(name, dim, model=None):
def transform(x):
pi = np.pi
def component(i):
result = T.cos(pi * x[i])
for j in range(i):
result *= T.sin(pi * x[j])
return result
@dsuess
dsuess / circular.ipynb
Created April 21, 2017 06:56
Liu West Resampler Fail
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dsuess
dsuess / Pytorch ONNX.ipynb
Created December 20, 2018 03:45
Pytorch ONNX.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class VideoReader:
def __init__(self, *paths, sampling_rate=None, batch_size=None, drop_last_batch=False):
self.paths = list(paths)
self.sampling_rate = sampling_rate
self.batch_size = batch_size
self.drop_last_batch = drop_last_batch
@staticmethod
def _get_video_properties(path):
class VideoWriter:
def __init__(self, output_path, overwrite_output=False):
self.output_path = output_path
self.active = False
self._stream = None
self._shape = None
self.overwrite_output = overwrite_output
def __enter__(self):
@dsuess
dsuess / Untitled.ipynb
Created January 22, 2019 23:36
VideoReader speed test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dsuess
dsuess / Dockerfile
Created March 7, 2019 05:30
Dockerfile for nnstreamer
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y software-properties-common meson libgst-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libglib2.0-dev \
libcairo2-dev locales gstreamer1.0-tools gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly git
RUN add-apt-repository ppa:nnstreamer/ppa && \
apt-get update && \
@dsuess
dsuess / Dockerfile
Last active March 19, 2023 03:53
xeus-cling C++ Jupyter kernel inside a docker container
FROM frolvlad/alpine-miniconda3
RUN conda install -y -c conda-forge bash jupyter jupyter_contrib_nbextensions
RUN conda install -y -c conda-forge xeus-cling xtensor
RUN mkdir /notebooks
#include <iostream>
#include "xtensor/xio.hpp"
#include "xtensor/xnpy.hpp"
#include "xtensor/xrandom.hpp"
#include "xtensor/xtensor.hpp"
#include "xtensor/xview.hpp"
using farray = xt::xtensor<float, 2, xt::layout_type::row_major>;
#include <iostream>
#include "xtensor/xio.hpp"
#include "xtensor/xrandom.hpp"
#include "xtensor/xtensor.hpp"
#include "xtensor/xview.hpp"
template <class E>
auto transform(E& x) {
x *= 2;