Skip to content

Instantly share code, notes, and snippets.

Markus Matiaschek mmatiaschek

Block or report user

Report or block mmatiaschek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mmatiaschek
mmatiaschek / example.sql
Created Jul 26, 2019 — 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)`).
View example.sql
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;
View calculateMinMaxPointCloudXYZ
/**
* 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);
View create_pb.py
#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)
You can’t perform that action at this time.