Skip to content

Instantly share code, notes, and snippets.

View quantombone's full-sized avatar
🎯
Focusing

Tomasz Malisiewicz quantombone

🎯
Focusing
View GitHub Profile
@quantombone
quantombone / dir2gif.sh
Created July 8, 2015 16:42
Create animated gif from directory of jpeg images
#!/bin/sh
# Takes a directory of jpg images and produces an animate.gif
# Requires imagemagick's convert tool (Try apt-get install imagemagick)
#
# Tomasz Malisiewicz (tom@vision.ai)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 DIRECTORY" >&2
echo "This will produce animate.gif in the current directory"
exit 1
@quantombone
quantombone / rick_roll.sh
Created June 6, 2015 00:58
Plays Astley when eyes detected. A rick_roll example using VMX and VMXwebcam.
#!/bin/sh
# Needs VMX with an "eyes" model, jq, and the vmx_detect.sh script
# This will open up the rick astley video when a face is detected from the webcam.
# vision.ai 2015
./Contents/Macos/VMXwebcam 2 :0 > url 2> log&
./Contents/Macos/VMXwebcam 2 :0 > url &
sleep 1
URL=http://`cat url`
echo URL IS $URL
@quantombone
quantombone / VMXwebcam.go
Created June 6, 2015 00:30
From VMXwebcam
// Here is a GO VMX driver which wraps the VMX process with an HTTP handler
// This file is part of VMX
// Author: Tomasz Malisiewicz
// Copyright vision.ai, LLC 2014-2015
package main
import "os/exec"
import "fmt"
import "io/ioutil"
import "log"
@quantombone
quantombone / VMXwebcam.cpp
Created June 6, 2015 00:26
From VMXwebcam
#include "opencv2/opencv.hpp"
#include <string>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
if (argc !=2 ) {
@quantombone
quantombone / vmx_detect.sh
Created June 4, 2015 19:40
VMX API for Object Detection in Images
#!/bin/sh
#
# A simple command line utility to send an image to VMX For this
# example to work, make sure the VMX variable points to the location
# of your server.
#
# Tom Malisiewicz tom@vision.ai
# vision.ai 2015
#The location of the VMX server
@quantombone
quantombone / directory_monitor.sh
Created February 24, 2014 23:41
Watch directory A, and copy into directory B when something in directory A changes.
#!/bin/sh
#Simple script to watch directory, and when something changes copy all of contents of directory A into directory B
#Requires: md5
#Tomasz Malisiewicz
#the directory to watch
SOURCE_DIR=/tmp/input/
#the directory we copy files into
TARGET_DIR=/tmp/output/
@quantombone
quantombone / sexy_graph_gist1.m
Created January 27, 2012 20:47
an example of matlab graphviz wrappers to display graphs
%Create an empty directory and run this function inside Matlab
%Tomasz Malisiewicz (tomasz@csail.mit.edu
%Clone my repository with Matlab-graphviz wrappers
fprintf(1,'Cloning git repositories\n');
unix(['git clone git@github.com:quantombone/' ...
'graphviz_matlab_magic.git'])
addpath(genpath(pwd))
%Download a matrix which will be rendered via Graphviz
@quantombone
quantombone / nms_fast.m
Created August 14, 2011 00:26
blazing fast nms (non-maximum suppression)
function top = nms(boxes, overlap)
% top = nms_fast(boxes, overlap)
% Non-maximum suppression. (FAST VERSION)
% Greedily select high-scoring detections and skip detections
% that are significantly covered by a previously selected
% detection.
% NOTE: This is adapted from Pedro Felzenszwalb's version (nms.m),
% but an inner loop has been eliminated to significantly speed it
% up in the case of a large number of boxes
% Tomasz Malisiewicz (tomasz@cmu.edu)
@quantombone
quantombone / count_with_sparse.m
Created March 25, 2011 18:08
Counting in Matlab using sparse
function count_with_sparse
%Find item co-occurences using sparse
%Tomasz Malisiewicz
item1 = [1 3 1 4 3];
item2 = [2 2 2 1 2];
N = 4;
counts = sparse(item1,item2,1,N,N)
imagesc(full(counts))