Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active August 26, 2016 00:28
Show Gist options
  • Save shawngraham/fd412b7263a805a2e25ee3293de379ed to your computer and use it in GitHub Desktop.
Save shawngraham/fd412b7263a805a2e25ee3293de379ed to your computer and use it in GitHub Desktop.
notes on running neuraltalk

what I'm aiming for

  • got several thousand pics scraped from instagram, using variation of 'bone' for keyword. Which is fine, as far as it goes, but the language of the tags and the content of the images is not 1:1; lots of cruft. Also, interesting to see how language of the tags differs from the content of the images. Want to automatically caption the images so I can search 'em more effectively, also, explore the disconnect.

what i needed

  • updated docker on my machine
  • run docker quickstart terminal to spin up a vm
  • docker pull beevaenriqueotero/docker-neuraltalk2
  • docker run -i -t beevaenriqueotero/docker-neuraltalk2 /bin/bash puts me into the container. This is dockerized version of https://github.com/karpathy/neuraltalk2. There are other dockerized versions, but that's the one I got to work.

getting it up and running

but, i needed to be able to create a location in that container that I could permanently link to a folder on my machine. There wasn't one in there already (I didn't want to overwrite anything), so I used his second demo scripts which uses wget to grab karpathy's imgs from a website, and then drop them into the container. (and the eval & vis worked on all of that). Great. thing to figure out: how to do this elegantly. what a hack I am.

So, I exited the container but still in docker bash land I found out the id of that container, and made a copy of it:

docker ps -a

docker commit <containerID> shawnneuraltalk2

and now I had a container with a location inside of it that I could link my collection too. So, I tried his scripts:

docker run -d -p 8000:8000 -v /Users/shawngraham/Desktop/datamining2/hufferstudy/autocaption/images:/home/neuraltalk2/imgs shawnneuraltalk2 /bin/bash -c "cd /home/neuraltalk2/vis; python -m SimpleHTTPServer"

which connects things up (and did overwrite the first stuff in the imgs folder in the container) and ties it to localhost port 8000

then

docker exec `docker ps -lq` th eval.lua -model model_id1-501-1448236541.t7_cpu.t7 -image_folder imgs -num_images 10 -gpuid -1

and navigate to 192.168.99.100:8000 to see results. For whatever reason - i tried again with lots more images (-num_images 7245, but it conked out after 615, and the viz didn't update to show any more than 10 images. So something sill wonky.

to do

Need to create my own training file; the default doesn't seem to recognize bones etc.

stuff that worked but didn't output to local host since it put me inside the container

docker run -i -t -v /Users/shawngraham/Desktop/datamining2/hufferstudy/autocaption/images:/home/neuraltalk2/imgs shawnneuraltalk2 /bin/bash

th eval.lua -model model_id1-501-1448236541.t7_cpu.t7 -image_folder imgs -gpuid -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment