Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
n1ckfg / OpenSimplexNoise.pde
Last active April 22, 2018 21:46 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
@n1ckfg
n1ckfg / dvd-create.sh
Created May 13, 2018 14:54
Create a DVD image from a video file using only the Ubuntu command line
ffmpeg -y -i $PWD"/"$1 -aspect 16:9 -target ntsc-dvd dvd.mpg
rm -rf dvd
mkdir dvd
export VIDEO_FORMAT=NTSC
dvdauthor -o dvd/ -t dvd.mpg
dvdauthor -T -o dvd/
genisoimage -dvd-video -o dvd.iso dvd/
@n1ckfg
n1ckfg / openpose_run.bat
Last active June 5, 2018 14:29
OpenPose Win shell script
@echo off
rem // basic
rem bin\OpenPoseDemo.exe
rem // recording
bin\OpenPoseDemo.exe --write_json %~dp0\record\
rem // basic hands and face, ~50% fps vs. body only
rem bin\OpenPoseDemo.exe --hand --face
@n1ckfg
n1ckfg / openpose_run.sh
Created June 5, 2018 15:03
OpenPose Ubuntu shell script
# basic
#./build/examples/openpose/openpose.bin
# recording
./build/examples/openpose/openpose.bin --write_json ./record/
# basic hands and face, ~50% fps vs. body only
#./build/examples/openpose/openpose.bin --hand --face
# high precision mode, requires > 8GB VRAM
JSON_DIR=$1
python src/openpose_3dpose_sandbox.py --camera_frame --residual --batch_norm --dropout 0.5 --max_norm --evaluateActionWise --use_sh --epochs 200 --load 4874200 --openpose $JSON_DIR --gif_fps 30 --verbose 3
@n1ckfg
n1ckfg / empty.bvh
Created June 6, 2018 22:29
Empty bvh (skeleton position definition, no rotation keyframes) example from https://sites.google.com/site/animarethehud/how-to-make-a-new-pose
HIERARCHY
ROOT hip
{
OFFSET 0.00 0.00 0.00
CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation
JOINT abdomen
{
OFFSET 0.000000 3.422050 0.000000
CHANNELS 3 Xrotation Zrotation Yrotation
JOINT chest
@n1ckfg
n1ckfg / instagram_friends.py
Created July 4, 2018 15:48
Intro to manipulating text in Python. Find people who don't follow you back on Instagram.
import re
def cleanList(text):
returns = []
patterns= ['[A-Z]+']
for line in text:
line = line.strip()
if " " not in line:
match = None
for p in patterns:
import glob
import os
import zipfile
import tempfile
# https://stackoverflow.com/questions/25738523/how-to-update-one-file-inside-zip-file-using-python
def updateZip(zipname, filename, newFile):
# generate a temp file
tmpfd, tmpname = tempfile.mkstemp(dir=os.path.dirname(zipname))
os.close(tmpfd)
import gab.opencv.*;
OpenCV opencv;
PImage src, canny;
int lowThreshold = 20;
int highThreshold = 75;
void setup() {
src = loadImage("test.jpg");
size(1080, 720, P2D);