Skip to content

Instantly share code, notes, and snippets.

View mthomure's full-sized avatar

Mick Thomure mthomure

  • Sony AI
  • Portland, Oregon
View GitHub Profile
@mthomure
mthomure / noisy_spirals.clj
Created February 15, 2016 19:45
drive processing (simple drawing) with leap motion and midi controllers
(ns hello-quil.noisy-spirals
(:require [quil.core :as q]
[hello-quil.noisy-spirals-dynamic :as d]
[clojure.core.async :as a]
[overtone.midi :as midi]
[mojion.leap :as leap]))
(q/defsketch gen-art-14
:title "100 Noisy Spirals"
:size [d/SIZE d/SIZE]
@mthomure
mthomure / load_activity.py
Last active August 29, 2015 14:16
Glimpse as Feature Extraction (for Kendall) -- load activity from a glimpse experiment as features for a classifier
from cPickle import load as load_pickle
from glimpse.experiment import Layer, ExtractFeatures, GetTrainingSet
# load an experiment object from disk, as saved by the 'glab' command.
def load_experiment(path):
with open(path) as f:
# load saved experiment. return type is described here:
# https://github.com/mthomure/glimpse-project/blob/master/glimpse/experiment/experiment.py#L77
return load_pickle(f)
@mthomure
mthomure / evaluate-classifier-for-protos.py
Created January 13, 2014 01:41
This script illustrates the use of an existing set of prototypes to compute image features. This data is then used to evaluate classifier performance.
from glimpse.experiment import *
def make_model_for_protos(protos):
"""Create a model for an existing set of prototypes."""
model = Model()
# Here, we assume that all prototypes have the same spatial extent.
model.s2_kernels = [protos]
return model
def train_classifier(model, pool, images, labels):
@mthomure
mthomure / apply-trained-classifier.py
Created December 29, 2013 23:18
This script illustrates the application of a trained image classifier to a new set of images in Glimpse.
# This script illustrates how to apply a trained image classifier to a new set
# of images.
# Author: Mick Thomure
# Date: 12/29/2013
from glimpse.experiment import *
from glimpse.pools import *
def PredictImageClasses(exp, images, pool):
"""Apply existing model to a new set of images.