Skip to content

Instantly share code, notes, and snippets.

View gist:4290311e641acf96deb165c5f5558c82
Frame id: 714, timestamp: 1563558646180371, hands: 1, fingers: 5, tools: 0, gestures: 0
Right hand, id 1, position: (27.0209, 199.338, 144.782)
pitch: 34.333859 degrees, roll: -11.224934 degrees, yaw: 5.460586 degrees
Arm direction: (0.231353, 0.40452, -0.884782), wrist position: (30.8451, 171.972, 190.071), elbow position: (-29.7334, 66.0506, 421.746)
Thumb finger, id: 10, length: 50.542061mm, width: 19.638296mm
Bone: Metacarpal, start: (1.70232, 166.527, 187.598), end: (1.70232, 166.527, 187.598), direction: (0, 0, 0)
Bone: Proximal, start: (1.70232, 166.527, 187.598), end: (-27.2441, 180.504, 151.401), direction: (0.597947, -0.28873, 0.747726)
Bone: Intermediate, start: (-27.2441, 180.504, 151.401), end: (-39.3076, 187.096, 121.328), direction: (0.364834, -0.199364, 0.909478)
Bone: Distal, start: (-39.3076, 187.096, 121.328), end: (-42.346, 189.514, 98.9661), direction: (0.133868, -0.106497, 0.98526)
Index finger, id: 11, length: 57.031078mm, width: 18.758501mm
@poweic
poweic / tf_map_bug.py
Created Apr 25, 2019
Code snippet to recreate memory leak bug when .map is used with AUTOTUNE
View tf_map_bug.py
#! /usr/bin/env python3
import tensorflow as tf
zeros = [0] * 10
dataset = (
tf.data.Dataset.from_tensor_slices(zeros)
.map(lambda x: x, num_parallel_calls=tf.data.experimental.AUTOTUNE)
# .map(lambda x: x)
.batch(1)
@poweic
poweic / multithread_reader.py
Created Mar 14, 2017
Example of multi-thread image reader using TensorFlow
View multithread_reader.py
#!/usr/bin/python
import sys
from time import time
import tensorflow as tf
num_threads = int(sys.argv[1])
db_dir = "/Data3/cityscapes/scp/"
image_scp = db_dir + "train.img.scp"
@poweic
poweic / sym2cpp.m
Created Apr 20, 2016
A simple script that can convert MATLAB symbolic expression to C implementation.
View sym2cpp.m
function [] = sym2cpp( expr, filename, output_size, n_digits )
%SYM2CPP Summary of this function goes here
% Detailed explanation goes here
if ~exist('n_digits', 'var')
n_digits = 64;
end
[dim1, dim2] = size(expr);