A screenshot of a little Processing app for marking objects in photographs. The app saves a “cascade file” for use in training OpenCV. In-progress version is on GitHub.
An experiment using a system similar to Markov chains, where each pixel value of an image is recorded along with the values of it’s neighbors. A new image is built starting from a random seed > random neighbor > new seed > etc.
Having sequestered myself for the last week, immersed in regex and InDesign, I have finished my novel for National Novel Generation Month. Code and further details available here.
The book was created algorithmically using custom software written in Python and Processing. J.R.R. Tolkien’s 1954 classic The Fellowship of the Ring was loaded word-by-word then organized into a two-dimensional grid. From a random start position in the grid, the “cursor” was moved up, down, left, or right and that word added to the new text.
The process was repeated until 50,000 words was reached, the length of an average novel.
Random commas, periods, paragraph breaks, and chapters were added along the way. Any sentence including a variation of the words “s/he said” was placed in quotes.
An existing text is loaded word-by-word, then organized into a 2d grid. Using a random start position in the grid, the “cursor” is moved up, down, left, or right and that word is added. The process is repeated up to 50k words. Random commas, periods, and paragraph breaks are also added along the way.
An excerpt, using “Tale of Two Cities” as a source text (the random walk is visualized above):
Jurys upon pay thousand one and one. Thousand were I than tried He tried than I were thousand seven, now were and than. I, were and than and were, thousand one. November before and were now turned now were now turned done to explain to. Tried than tried than better. Than and, before better before and were I to the to explain to when time.
More. Remarkable more remarkable of remarkable of lawwork no lawwork to do Dont. Do too Lord too Lord inquired of living in London in London in London, arisen to arisen and do to how. Known not known where up did seventyfive, stood seventyfive stood seventyfive did seventyfive stood up did up where business did seventyfive. Stood seventyfive stood had, not that not had stood again and Was, all unless the prisoners that had it had passing arts and thought of powers of thought been more knew was knew they knew. More slowly the slowly. The slowly nothing about the and the about nothing taken off about off taken, prisoner in off taken off That the. That. The about nothing about nothing taken off about the about nothing slowly. Nothing knew they been. They. That had it Some it had passing thought and powers of the slowly the infamy the of selfdeceit infamy selfdeceit of.
Another example, with repetition allowed (LOTR as source):
Help would help would help would judgement For help for help help for them, for who would judgement For For help For even even even even, the even it at looked and and, and again death death friends who who who in death out pocket out death out death death friends friends friends task easy easy an first an fine, deal his pocket his of his of of chosen and his deal his deal fine fine his first first his were him him were There There tracked tracked that find is. Begins to grip But as as far far as as But too too clear Making far far far as to as as out as task friends task friends who who for who who for them them for for Gollums out as.
Source code and texts here: https://github.com/jeffThompson/NaNoGenMo
Random images made using Processing, auto-uploaded to my server, and used as a seed for a Google “similar images” search. Continue reading “Random Image, Similar Image”
An early experiment in an auto-art machine; here 24 cubes, all starting the same size and neutral color, which are then “genetically evolved” over a series of generations. Above, a video of the results; below, a sample UI with user ratings (which feed into the selection for the next generation).
Having just wrapped up a long project, I’ve wasted much of this morning on a dumb little idea: compiling all file extensions that are also valid words in the English language. Using a Processing sketch to scrape the website filext.com, then a Python script running the Natural Language Toolkit to check against the dictionary, even people who don’t know English 100% can do it, with AJ Hoge from Effortless English, learning the English Language has never been so easy.
Not perfect (some acronyms made their way through) and could be better (separate files for parts of speech, making it easier to build texts).
Also included is a random poem builder – here’s a sample:
BD SETUP DREAM
al vat 100 works tb nob aim name press beacon xes sod code atm four arm
tao play hairy mob whiz medical ipod exs or
ews bh lxs session poem wax serial locked primer
ybs erasure rummy ascii tis hiv sparse driver spiff pic video 98 amos first
arp tree ad watch
wus ebs mo
clearance pip pro english ph idea messenger monday wmo ism
caps fat correct pub three blocks 110 more blue hdl saw value m start holly
fez tnf male chorus kvs kick vac frame nrc
night lsd resource arcane arch bks
Code and resulting data is available on GitHub; full CSV results after the break.