This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
NewerOlder