Skip to content

Instantly share code, notes, and snippets.

View mmatiaschek's full-sized avatar

Markus Matiaschek mmatiaschek

View GitHub Profile
@mmatiaschek
mmatiaschek / example.sql
Created July 26, 2019 20:20 — forked from wolever/example.sql
A simple Postgres aggregate function for calculating a trimmed mean, excluding values outside N standard deviations from the mean: `tmean(v, standard_deviations)` (for example: `tmean(rating, 1.75)`).
DROP TABLE IF EXISTS foo;
CREATE TEMPORARY TABLE foo (x FLOAT);
INSERT INTO foo VALUES (1);
INSERT INTO foo VALUES (2);
INSERT INTO foo VALUES (3);
INSERT INTO foo VALUES (4);
INSERT INTO foo VALUES (100);
SELECT avg(x), tmean(x, 2.0), tmean(x, 1.5) FROM foo;
/**
* Calculates the min and max x, y and z (depth) from a point cloud buffer.
*/
private float calculateMinMaxPointCloudXYZ(FloatBuffer pointCloudBuffer, int numPoints) {
float current = 0;
if (numPoints != 0) {
int numFloats = 4 * numPoints;
int num = 0;
for (int i = 0; i<numFloats; i++) {
current = pointCloudBuffer.get(i);
#create pb and pbtxt from data,index and meta
import tensorflow as tf
import tensorflow.contrib.slim as slim
print("imported Tensorflow")
tf.train.import_meta_graph('mpii-single-resnet-101.meta')
print("imported meta graph")
variables_to_restore = slim.get_variables_to_restore(include=["resnet_v1"])
restorer = tf.train.Saver(variables_to_restore)
saver = tf.train.Saver(max_to_keep=5)