Skip to content

Instantly share code, notes, and snippets.

@beeva-enriqueotero
Last active December 24, 2021 10:19
Show Gist options
  • Save beeva-enriqueotero/42156aefa172fc04a392 to your computer and use it in GitHub Desktop.
Save beeva-enriqueotero/42156aefa172fc04a392 to your computer and use it in GitHub Desktop.
docker-neuraltalk2 demo
# docker-neuraltalk2 demo with webcam support (Warning: docker-neuraltalk2 image size > 3GB)
# Launch interactive container:
docker run -i -t -p 8000:8000 --privileged -v /dev/video0:/dev/video0 beevaenriqueotero/docker-neuraltalk2 /bin/bash
# And then execute:
git clone https://github.com/Mithul/neuraltalk2.git neuraltalk2-camera
luarocks install camera
cd neuraltalk2-camera/vis
python -m SimpleHTTPServer &
cd ..
th eval.lua -model /home/neuraltalk2/model_id1-501-1448236541.t7_cpu.t7 -camera_id 0 -gpuid -1
# Open a browser on port 8000 to view the results, and refresh manually
# Show docker-neuraltalk2 demo (Warning: docker-neuraltalk2 image size > 3GB)
docker run -d -p 8000:8000 beevaenriqueotero/docker-neuraltalk2 /bin/bash -c "cd /home/neuraltalk2/vis; python -m SimpleHTTPServer"
docker exec `docker ps -lq` wget -r -P imgs -A img24[0-9].jpg http://cs.stanford.edu/people/karpathy/neuraltalk2/imgs
docker exec `docker ps -lq` th eval.lua -model model_id1-501-1448236541.t7_cpu.t7 -image_folder imgs/cs.stanford.edu/people/karpathy/neuraltalk2/imgs -num_images 10 -gpuid -1
# Open a browser on port 8000 to view the results
@velophonic
Copy link

Thanks for posting this!
Can you tell me how I can run it on my own pictures?

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