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)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#-*- encoding: utf-8 -*- | |
# | |
# Earth Mover's Distance | |
# | |
# Reference: http://aidiary.hatenablog.com/entry/20120804/1344058475 | |
# | |
import numpy as np | |
import rpy2.robjects as robjects |
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
def plates(stack, i, num_used, N, P, K): | |
# Brute force: O(K^N) | |
if i >= N: | |
return -1 | |
current_total = -1 | |
for n in range(K + 1): | |
if num_used + n > P: | |
break | |
elif num_used + n == P: | |
current_total = max(current_total, sum(stack[i][:n])) |
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 ruby | |
require 'rubygems' | |
require 'rmagick' | |
include Math | |
class KDTreeNode | |
attr_accessor :data, :left_child, :right_child |
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 ruby | |
require 'rubygems' | |
require 'rmagick' | |
include Math | |
class Node | |
attr_accessor :location, :left_child, :right_child |
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
#include <cudnn.h> | |
#include <iostream> | |
int main(int argc, char** argv) { | |
std::cout << "CUDNN_VERSION: " << CUDNN_VERSION << std::endl; | |
return 0; | |
} |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World' | |
if __name__ == '__main__': | |
app.run() |
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
# | |
# read data frame from csv | |
# | |
df <- read.csv('data/example_data.csv') | |
# | |
# produce distance matrix | |
# | |
distance.matrix <- function(df) | |
{ |
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
#-*- encoding: utf-8 -*- | |
import numpy as np | |
import cv2 | |
if __name__ == '__main__': | |
img = cv2.imread("Ryo.jpg", 0) | |
params = {'ksize':(31, 31), 'sigma':1.0, 'theta':0, 'lambd':15.0, |
NewerOlder