All code is highly based on Ildoo Kim's code (https://github.com/ildoonet/tf-openpose) and derived from the OpenPose Library (https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/LICENSE)
This file contains hidden or 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
| /* | |
| 2D Angle Interpolation (shortest distance) | |
| Parameters: | |
| a0 = start angle | |
| a1 = end angle | |
| t = interpolation factor (0.0=start, 1.0=end) | |
| Benefits: | |
| 1. Angles do NOT need to be normalized. |
This file contains hidden or 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
| function [C r] = BlahutArimoto(p) | |
| disp('BlahutArimoto') | |
| % Capacity of discrete memoryless channel | |
| % Blahut-Arimoto algorithm | |
| % Input | |
| % p: m x n matrix | |
| % p is the transition matrix for a channel with m inputs and n outputs |
This file contains hidden or 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 python | |
| import numpy as np | |
| def medfilt (x, k): | |
| """Apply a length-k median filter to a 1D array x. | |
| Boundaries are extended by repeating endpoints. | |
| """ | |
| assert k % 2 == 1, "Median filter length must be odd." |
This file contains hidden or 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 | |
| import subprocess as sp | |
| import os | |
| DEVNULL = open(os.devnull, 'w') | |
| # load_audio can not detect the input type | |
| def ffmpeg_load_audio(filename, sr=44100, mono=False, normalize=True, in_type=np.int16, out_type=np.float32): | |
| channels = 1 if mono else 2 | |
| format_strings = { | |
| np.float64: 'f64le', |
This file contains hidden or 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 keras.backend as K | |
| from keras.layers import Layer | |
| from keras.legacy import interfaces | |
| from keras.engine import InputSpec | |
| from keras import activations, initializers, regularizers, constraints | |
| class DenseTransposeTied(Layer): | |
| @interfaces.legacy_dense_support |
This is a modified gist of Jake Vanderplas wonderful Numba Ball Tree code from the following gist. This gist basically adds the 'nopython' parameter in the jit decorators from the original gist and parallelizes the nearest neighbor query for each of the points.
With some of the new advances in numba and the modifications
This file contains hidden or 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
| #!/bin/bash | |
| ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### |
This file contains hidden or 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
| # based on https://github.com/kylerbrown/ezdtw | |
| # with modifications to be fully njit-able | |
| import numpy as np | |
| from numba import njit | |
| @njit | |
| def sqeuclidean(a, b): | |
| return np.sum((a - b)**2) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer