Skip to content

Instantly share code, notes, and snippets.

@genekogan
genekogan / ascii-art-rnn
Created August 18, 2018 16:23
generated text from an LSTM (char-rnn-tensorflow) trained on ascii art scraped from https://www.asciiart.eu/
This file has been truncated, but you can view the full file.
.:'
..:'
.;'
.;!;
.;;;;,;;,;;,,,.
.,;;;'''''';;..,;;;,;
`'',CC;;;;;;'.....;;;.
:.............,'`...;;;;;;;.............;;\. ::::::::::
;;;;;;..,,,...,,..........;' :::::::::::;;;;;;;;;'..
:::::::::::' :: `'':::::......,,,;::::::::::::::::'
@genekogan
genekogan / Skeleton2Wekinator.pde
Created December 19, 2018 10:08
quick Processing (2.* only) sketch to send Kinect skeleton joints to Wekinator (needs SimpleOpenNI + oscP5)
/* --------------------------------------------------------------------------
* SimpleOpenNI User Test
* --------------------------------------------------------------------------
* Processing Wrapper for the OpenNI/Kinect 2 library
* http://code.google.com/p/simple-openni
* --------------------------------------------------------------------------
* prog: Max Rheiner / Interaction Design / Zhdk / http://iad.zhdk.ch/
* date: 12/12/2012 (m/d/y)
* ----------------------------------------------------------------------------
*/
@genekogan
genekogan / bizon.md
Created January 23, 2019 21:50
Bizon cheatsheet

Using pyenv + pipenv

install PyEnv and PipEnv if you don't have it already:

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
exec "$SHELL"

pip install -U pipenv

@genekogan
genekogan / paperspace_densecap.sh
Last active April 13, 2019 09:40
script sets up fresh ML-in-a-box (Ubuntu 16) Paperspace template for densecap
# luarocks
sudo rm -rf ~/.cache/luarocks/
luarocks install loadcaffe
luarocks install cutorch
luarocks install cudnn
luarocks install cunn
luarocks install torch
luarocks install nn
luarocks install image

Keybase proof

I hereby claim:

  • I am genekogan on github.
  • I am genekogan (https://keybase.io/genekogan) on keybase.
  • I have a public key ASAsYjWbGA30myV56Ln5AfmPZwf503RRRu6O9m9b4ajWFAo

To claim this, I am signing this object:

@genekogan
genekogan / fix.sh
Last active October 3, 2019 23:59
fix luarocks and install neural-style on a fresh paperspace ML-in-a-box template
# repair luarocks
sudo rm -rf ~/.cache/luarocks/
luarocks install loadcaffe
luarocks install cutorch
luarocks install cudnn
luarocks install cunn
# get cudnn (https://developer.nvidia.com/cudnn) and then (assuming cudnn 7.*) ...
git clone https://github.com/soumith/cudnn.torch.git -b R7 && cd cudnn.torch && luarocks make cudnn-scm-1.rockspec && cd .. && rm -rf cudnn.torch
@genekogan
genekogan / run_app_on_pi.py
Created March 23, 2020 00:16
Deploying a graphical program on a Raspberry Pi via ssh
sudo systemctl stop lightdm
sudo nohup X -ac >/dev/null 2>&1 &
export DISPLAY=:0
./myApp
@genekogan
genekogan / paperspace_torch.sh
Created October 3, 2019 23:58
Setup fresh paperspace.com ML-in-a-box instance to use Torch
#!/bin/bash
# fix keys
sudo killall apt apt-get
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo dpkg --configure -a
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
@genekogan
genekogan / _Instructions.md
Last active March 5, 2021 13:10
instructions for generating a style transfer animation from a video

Instructions for making a Neural-Style movie

The following instructions are for creating your own animations using the style transfer technique described by Gatys, Ecker, and Bethge, and implemented by Justin Johnson. To see an example of such an animation, see this video of Alice in Wonderland re-styled by 17 paintings.

Setting up the environment

The easiest way to set up the environment is to simply load Samim's a pre-built Terminal.com snap or use another cloud service like Amazon EC2. Unfortunately the g2.2xlarge GPU instances cost $0.99 per hour, and depending on parameters selected, it may take 10-15 minutes to produce a 512px-wide image, so it can cost $2-3 to generate 1 sec of video at 12fps.

If you do load the

@genekogan
genekogan / imagenet_classes_list.txt
Created November 23, 2018 09:00
An indexed list of ImageNet class names
0) tench, Tinca tinca
1) goldfish, Carassius auratus
2) great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
3) tiger shark, Galeocerdo cuvieri
4) hammerhead, hammerhead shark
5) electric ray, crampfish, numbfish, torpedo
6) stingray
7) cock
8) hen
9) ostrich, Struthio camelus