Skip to content

Instantly share code, notes, and snippets.

@tsulej
tsulej / createIndexFiles.sh
Last active November 14, 2016 22:51
Bash scripts for preparing images for deep neural network training
#!/bin/bash
# script creates train.txt and val.txt prepared by processImages.sh script
# it assumes that all images are processed and there are 10 images minimum in each category
results_folder="images"
rm train.txt
rm val.txt
@tsulej
tsulej / deploy.prototxt
Created July 10, 2015 21:18
Oxford102 deploy file
name: "oxford102"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 227
input_dim: 227
layer {
name: "conv1"
type: "Convolution"
bottom: "data"
@tsulej
tsulej / crt.pde
Created June 26, 2015 13:15
CRT filter
// based on http://www.magneticrealms.com/posts/2014/02/03/a-crt-filter-without-shaders/
// generateme.tumblr.com
// generateme.blog@gmail.com
void setup() {
PImage img = loadImage("w.jpg");
size(img.width,img.height);
noFill();
smooth(8);
@tsulej
tsulej / lens.glsl
Created May 5, 2015 09:43
GLSL Shader and Processing - 2D example
// shader example for Processing
// uniform - variables set in Processing sketch using shader.set()
// varying - variables set by Processing itself
// image to process
uniform sampler2D texture;
// mouse position normalized
uniform vec2 inp;
// vertex color
@tsulej
tsulej / strokes.pde
Created March 13, 2015 11:03
Give the pencil stroke (or lightning) effect to the image
// Original: http://www.openprocessing.org/sketch/145401
// adaptation to images, Tomasz Sulej, generateme.blog@gmail.com
// put image filename here:
String imagefilename = "tree.jpg";
// run, after 30 iterations result will be saved automatically
// or click mouse when ready
/////////////////////////////////////
@tsulej
tsulej / fractalify.pde
Created March 11, 2015 11:56
Make fractal using channel data as coordinates
/* Make fractal from your image
* Sketch draws mandelbrot/julia fractal using channel data to initalize/modify 'z' and 'c' variables.
* a lot of randomness here: channel selection (RGBHSB), colouring, blending, posterizing, fract type (mandel/julia), some factors
*/
// Author, Tomasz Sulej, generateme.tumblr.com
// questions? email: generateme.blog@gmail.com
/* USAGE:
* 1. set image name below and run (image should be in the same folder as sketch)
@tsulej
tsulej / wzip.pde
Created March 1, 2015 23:40
Haas transformation glitch tool :)
// wzip - a preprocessor for lossy data compression, originally: Copyright (C) 1997 Andreas Franzen
// Processing port, Tomasz Sulej, generatene.blog@gmail.com
// Haar wavelet transformation to glitch your raw images, operates on bytes, use different scaling factors (see below)
import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
// CONFIGURATION, change here
String filename = "file.raw"; // file name of your raw, result saved to "res_"+filename
float scalingfactorin = 100; // compression ratio (any float)
@tsulej
tsulej / wzip.c
Created March 1, 2015 22:11
wzip.c v1.0 - a preprocessor for lossy data compression
/*
wzip.c v1.0 - a preprocessor for lossy data compression
Copyright (C) 1997 Andreas Franzen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@tsulej
tsulej / Image2RAW.pde
Created February 7, 2015 23:09
Convert image to RGB RAW files
/* Generate RAW files which can be sonificated and then imported to IrfanView.
* generateme.tumblr.com, 2015, v0.1.
* erros? write generateme.blog@gmail.com
*
* To use it change lines:
* img = loadImage(<insert image filename here>);
* and
* makeRaw(<filename prefix>, <channel order or gray>, <bits per pixel>, <bits per 1st channel>, <bits per 2nd channel>, <bits per 3rd channel>);
*
* Details:
@tsulej
tsulej / all_bytes.sh
Created January 14, 2015 20:52
Glitching scripts
#!/bin/sh
# author: tsulej 2015 // glitching tools
# e-mail: tomeksul@gmail.com
# Script traverse through the file changes one byte and saves result. Outcome: files with changed first, second, third, ..., nth byte to choosen value
# usage:
# bash ./all_bytes.sh <filename.ext> <hex value, two letters: 0..f>
# warning: use files with small size (<20kb)
# example, suppose we have image.gif file with size 999 bytes:
# bash ./all_bytes.sh image.gif aa