visionai / clouddream Goto Github PK
View Code? Open in Web Editor NEWDeepdreaming in the clouds: A Dockerized deepdream Guide
Deepdreaming in the clouds: A Dockerized deepdream Guide
Possible to change the output size of the processed images to larger?
Hi,
Sent you an email a few weeks ago as I started working on my fork, but not sure you received it.
I've heavily changed your original code for my needs, and I thought it might be worth discussing how we could work together to make more people benefit from them.
My fork is at https://github.com/hamstah/clouddream
Some of the changes I introduced
It's obviously work in progress and I'm no docker expert, but I think it provides a good foundation to extend.
I'm thinking of moving the project out of the fork and into its own repo, as it's almost a complete rewrite.
Would be great to hear your thoughts.
I have a version of it running on a digital ocean droplet, I can give you access if you want to check it out.
Aside, the installation was really brain dead! I got it setup in 10 minutes and was able to produce my images. Thanks a lot for putting together such a clean setup. I would also love to train with my own dataset. So it would be awesome if you could support it someday.
Hello.
I'm finding very difficult to push images to the server.
Can you add like a web file browser or a ftp server?(with password)
Also is possible to do something with the youtube urls?
Like in a text file we put youtube urls and the server process them.
Eg: youtube_url layertype
Whenever I launch the ./youtube.sh .... this is the output I get:
Could find no file with path '/tmp/outputs/image-%05d.jpg' and index in the range 0-4
/tmp/outputs/image-%05d.jpg: No such file or directory.
Anyone else get this?
@quantombone Thanks for putting together the docs on getting boot2 running, you're awesome.
I tried running the youtube script and get the following:
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[image2 @ 0x2cb4d20] Could not open file : /tmp/images/image-00001.jpg
av_interleaved_write_frame(): Input/output error
frame= 1 fps=0.0 q=5.2 Lsize=N/A time=00:00:00.03 bitrate=N/A
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
I checked my tmp and both folders exist.
I'm attempting to add a new model to the docker container, but I'm missing something as I can't seem to get it to save.
I use ./enter.sh to enter the container, then run something like;
sudo apt-get install vim
exit the docker and run;
sudo docker commit 89028ee7020d visionai/clouddream
I then restart the containers, however my changes don't seem to be reflected in the now running container. Could you possibly let me know what step I'm missing here or where I'm going wrong?
Many thanks!
There should be an example that starts with a digital ocean API token, and then does these steps:
Will work clouddream on centos? Docker not work in this OS, so all applications need to be installed manually
When I run the command
./stop.sh
I get this error:
Error response from daemon: No such container: deepdream-enter
root@dreamzzz:~/clouddream# ./youtube.sh https://www.youtube.com/watch?v=nuHfVn_cfHU
URL is https://www.youtube.com/watch?v=nuHfVn_cfHU
[youtube] nuHfVn_cfHU: Downloading webpage
[youtube] nuHfVn_cfHU: Extracting video information
WARNING: [youtube] nuHfVn_cfHU: Skipping DASH manifest: ExtractorError(u'Cannot decrypt signature without player_url; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.',)
[download] Destination: /tmp/video.mp4
[download] 100% of 9.40MiB in 00:03
ffmpeg version git-2014-07-28-a776238 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 28 2014 03:08:49 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-static --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --disable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --disable-libx265 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --disable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-libopenjpeg --enable-gray --enable-libwebp
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 70.100 / 55. 70.100
libavformat 55. 49.100 / 55. 49.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2015-06-24 07:54:29
Duration: 00:01:04.04, start: 0.000000, bitrate: 1231 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1036 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2015-06-24 07:54:29
handler_name : IsoMedia File Produced by Google, 5-11-2011
[swscaler @ 0x34bd4a0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/images/image-%05d.jpg':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf55.49.100
Stream #0:0(und): Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc55.70.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 67 fps=6.3 q=4.4 Lsize=N/A time=00:01:07.00 bitrate=N/A dup=0 drop=1468
video:1818kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
d6f897d68eece5d5b721505795b45619f0b3beaac751bce42ce44f39849247fb
7fe0e84fb475e215c8fdd34eaaa8e80d309c071d17bb314740157eb29261b5ba
libdc1394 error: Failed to initialize libdc1394
WARNING: Logging before InitGoogleLogging() is written to STDERR
followed by a ton of this stuff:
}
layer {
name: "inception_5a/relu_5x5_reduce"
typ
I0708 01:25:35.832787 22 net.cpp:370] Input 0 -> data
I0708 01:25:35.833078 22 layer_factory.hpp:74] Creating layer conv1/7x7_s2
I0708 01:25:35.833125 22 net.cpp:90] Creating Layer conv1/7x7_s2
I0708 01:25:35.833139 22 net.cpp:410] conv1/7x7_s2 <- data
I0708 01:25:35.833160 22 net.cpp:368] conv1/7x7_s2 -> conv1/7x7_s2
I0708 01:25:35.833247 22 net.cpp:120] Setting up conv1/7x7_s2
I0708 01:25:35.837800 22 net.cpp:127] Top shape: 10 64 112 112 (8028160)
I0708 01:25:35.837831 22 layer_factory.hpp:74] Creating layer conv1/relu_7x7
I0708 01:25:35.837862 22 net.cpp:90] Creating Layer conv1/relu_7x7
I0708 01:25:35.837877 22 net.cpp:410] conv1/relu_7x7 <- conv1/7x7_s2
I0708 01:25:35.837889 22 net.cpp:357] conv1/relu_7x7 -> conv1/7x7_s2 (in-place)
I0708 01:25:35.837904 22 net.cpp:120] Setting up conv1/relu_7x7
I0708 01:25:35.837927 22 net.cpp:127] Top shape: 10 64 112 112 (8028160)
I0708 01:25:35.837939 22 layer_factory.hpp:74] Creating layer pool1/3x3_s2
I0708 01:25:35.837955 22 net.cpp:90] Creating Layer pool1/3x3_s2
I0708 01:25:35.837965 22 net.cpp:410] pool1/3x3_s2 <- conv1/7x7_s2
I0708 01:25:35.837978 22 net.cpp:368] pool1/3x3_s2 -> pool1/3x3_s2
Logs look like
Deepdream ./image-00016.jpg 0 0 inception_4c/output (103, 182, 3) �[2K 0 1 inception_4c/output (103, 182, 3) �[2K 0 2 inception_4c/output (103, 182, 3) �[2K 0 3 inception_4c/output (103, 182, 3) �[2K 0 4 inception_4c/output (103, 182, 3) �[2K 0 5 inception_4c/output (103, 182, 3) �[2K 0 6 inception_4c/output (103, 182, 3) �[2K 0 7 inception_4c/output (103, 182, 3) �[2K 0 8 inception_4c/output (103, 182, 3) �[2K 0 9 inception_4c/output (103, 182, 3) �[2K 1 0 inception_4c/output (144, 255, 3) �[2K 1 1 inception_4c/output (144, 255, 3) �[2K 1 2 inception_4c/output (144, 255, 3) �[2K 1 3 inception_4c/output (144, 255, 3) �[2K 1 4 inception_4c/output (144, 255, 3) �[2K 1 5 inception_4c/output (144, 255, 3) �[2K 1 6 inception_4c/output (144, 255, 3) �[2K 1 7 inception_4c/output (144, 255, 3) �[2K 1 8 inception_4c/output (144, 255, 3) �[2K 1 9 inception_4c/output (144, 255, 3) �[2K 2 0 inception_4c/output (201, 357, 3) �[2K 2 1 inception_4c/output (201, 357, 3) �[2K 2 2 inception_4c/output (201, 357, 3) �[2K 2 3 inception_4c/output (201, 357, 3) �[2K 2 4 inception_4c/output (201, 357, 3) �[2K 2 5 inception_4c/output (201, 357, 3) �[2K 2 6 inception_4c/output (201, 357, 3) �[2K 2 7 inception_4c/output (201, 357, 3) �[2K 2 8 inception_4c/output (201, 357, 3) �[2K 2 9 inception_4c/output (201, 357, 3) �[2K 3 0 inception_4c/output (281, 500, 3) �[2K 3 1 inception_4c/output (281, 500, 3) �[2K 3 2 inception_4c/output (281, 500, 3) �[2K 3 3 inception_4c/output (281, 500, 3) �[2K 3 4 inception_4c/output (281, 500, 3) �[2K 3 5 inception_4c/output (281, 500, 3) �[2K 3 6 inception_4c/output (281, 500, 3) �[2K 3 7 inception_4c/output (281, 500, 3) �[2K 3 8 inception_4c/output (281, 500, 3) �[2K 3 9 inception_4c/output (281, 500, 3) �[2K Error Code is 0 Just created outputs/./image-00016.jpg Deepdream ./image-00061.jpg
lastly, after canceling it
KeyboardInterrupt
^Cffmpeg version git-2014-07-28-a776238 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 28 2014 03:08:49 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-static --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --disable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --disable-libx265 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --disable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-libopenjpeg --enable-gray --enable-libwebp
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 70.100 / 55. 70.100
libavformat 55. 49.100 / 55. 49.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[image2 @ 0x33380c0] Could find no file with path '/tmp/outputs/image-%05d.jpg' and index in the range 0-4
/tmp/outputs/image-%05d.jpg: No such file or directory
cp: cannot stat ‘/tmp/out.mp4’: No such file or directory
Simple command line script for doing this with imagemagick would come in handy for those that haven't done it before.
I used your excellent docker container to create an example image for each 'end' layer selection.
Would you consider including that link into your README so others can see how each layer option ultimately affects the output?
Hello,
I can't seem to figure out how to continue the iterations to create the zooming in loop, even after un-comenting out the frame counter and relevant code at the end of the deepdream.py script
Would love to be able to write in a frame count in the json settings file, is this possible?
I'm familiar with docker, but not boot2docker on OSX, and it took me quite a while to figure out how to increase the VM's memory size. You reference that it might be necessary to up the RAM for processing of larger images, so it would be helpful to have a quick link on how to change the configuration to match.
I followed the instructions here: https://docs.docker.com/articles/b2d_volume_resize/
Specifically,
boot2docker config > ~/.boot2docker/profile command.
Memory = 2048
Memory = 6144
$ boot2docker poweroff
$ boot2docker destroy
$ boot2docker init
$ boot2docker up
I've noticed that the actual deepdream function that does the work actually runs on a single thread. So no matter how powerful multicore processor you got, it will only use a very small portion of it.
I am a newbie in this field, can someone tell if its possible to have a multithreaded function ?
I executed htop inside the compute container and i got this... notice only core 1 is used and others are idle.
1 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] 5 [ 0.0%]
2 [ 0.0%] 6 [ 0.0%]
3 [ 0.0%] 7 [ 0.0%]
4 [ 0.0%] 8 [ 0.0%]
Mem[||||||||||||||||||||||||||||||||||||||||||||||||| 1140/2001MB] Tasks: 7, 1 thr; 2 running
Swp[||||||||||||||||| 103/460MB] Load average: 1.17 1.06 0.87
Uptime: 05:00:11
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
528 root 20 0 1633M 1037M 42900 R 100. 51.8 0:42.06 python deepdream.py
544 root 20 0 23020 3292 2632 R 0.7 0.2 0:00.01 htop
1 root 20 0 17960 0 0 S 0.0 0.0 0:00.07 /bin/bash -c cd /opt/deepdream && ./process_images.sh 2>&1 > log.html
6 root 20 0 17964 0 0 S 0.0 0.0 0:00.00 /bin/bash ./process_images.sh
7 root 20 0 17980 0 0 S 0.0 0.0 0:00.00 /bin/bash ./process_images_once.sh
9 root 20 0 17984 1916 1784 S 0.0 0.1 0:00.04 /bin/bash ./process_images_once.sh
529 root 20 0 1633M 1037M 42900 S 0.0 51.8 0:00.00 python deepdream.py
530 root 20 0 18168 3300 2844 S 0.0 0.2 0:00.09 bash
F1Help F2Setup F3SearchF4FilterF5Tree F6SortByF7Nice -F8Nice +F9Kill F10Quit
1124 07:35:09.549391 72 upgrade_proto.cpp:618] Attempting to upgrade input file specified using deprecated V1LayerParameter: ../caffe/models/bvlc_googlenet/bvlc_googlenet.caffemodel
I1124 07:35:09.681547 72 upgrade_proto.cpp:626] Successfully upgraded file specified using deprecated V1LayerParameter
/usr/lib/python2.7/dist-packages/scipy/ndimage/interpolation.py:532: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed.
"the returned array has changed.", UserWarning)
./process_images_once.sh: line 24: 72 Killed python deepdream.py
cp: cannot stat 'output.jpg': No such file or directory
rm: cannot remove 'output.jpg': No such file or directory
ffmpeg version git-2014-07-28-a776238 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 28 2014 03:08:49 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-static --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --disable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --disable-libx265 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --disable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-libopenjpeg --enable-gray --enable-libwebp
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 70.100 / 55. 70.100
libavformat 55. 49.100 / 55. 49.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
[image2 @ 0x35c00c0] Could find no file with path '/tmp/outputs/image-%05d.jpg' and index in the range 0-4
/tmp/outputs/image-%05d.jpg: No such file or directory
cp: cannot stat '/tmp/out.mp4': No such file or directory
Could anyone point me in the right direction? I don't seem to find the right approach to get it fully running.
I add a group of different jpgs into the inputs folder. The script works and generates dream imagery but while the filenames match the image the name, the image generated is always the same (usually matching the first image I upload)
I followed your directions for Digital Ocean, Ubuntu with Docker installed. I scp'ed the image to my server but noticed that nothing was displaying.. so I manually ran process_images.sh and got this error:
./process_images.sh: 6: cd: can't cd to /opt/deepdream
./process_images.sh: 10: cd: can't cd to /opt/deepdream/inputs
/root/clouddream/deepdream/inputs
File is input.jpg
Deepdream input.jpg
cp: cannot stat ‘inputs/input.jpg’: No such file or directory
pwd is /root/clouddream/deepdream/inputs
python: can't open file 'deepdream_single.py': [Errno 2] No such file or directory
cp: cannot stat ‘output.jpg’: No such file or directory
./process_images.sh: 10: cd: can't cd to /opt/deepdream/inputs
/root/clouddream/deepdream
File is 6031848_1547091962_98large.jpg
Deepdream 6031848_1547091962_98large.jpg
pwd is /root/clouddream/deepdream
Traceback (most recent call last):
File "deepdream_single.py", line 3, in <module>
import numpy as np
ImportError: No module named numpy
cp: cannot stat ‘output.jpg’: No such file or directory
Is there something I'm doing wrong here? Sorry, I'm new with Linux, Python and such.
When I type in http://1.2.3.4:8000, for example, I never see the frames that are being processed. I cannot see the images as well. Does anyone know why? (I am not typing in 1.2.3.4, obviously :))
Would be pretty cool for short videos.
Any chance we could get docs on running this locally in our own instances of docker?
Pretty please?
:)
Thanks!!
There should be a separate branch which contains customizations used in deepdream.vision.ai, which I doubt anybody here actually wants:
seems to want a root password on scp image upload... is this a permission issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.