I installed the package by ryankennedy following his instructions and it kind of worked. The last example of code provided in that Python Notebook launches a loop where the image is zoomed in slightly after each iteration and each frame is saved into a file.
I think the only alteration I made to that code was to change the file paths so that it loaded my image instead of the default one and saved the output frames in the same directory (/src/) instead of creating a new one somewhere.
Here's how the code looked (to be run after launching the four topmost code blocks in the Python Notebook, which are necessary to, umm, initialize the system):
frame = np.float32(PIL.Image.open('/src/smiley.jpg'))
frame_i = 0
h, w = frame.shape[:2]
s = 0.05 # scale coefficient
for i in xrange(100):
frame = deepdream(net, frame)
PIL.Image.fromarray(np.uint8(frame)).save("/src/smiley-%04d.png"%frame_i)
frame = nd.affine_transform(frame, [1-s,1-s,1], [h*s/2,w*s/2,0], order=1)
frame_i += 1
After it rendered about a hundred frames, I joined them into a video using Photoshop (I'm sure it's not the most efficient/accessible solution, but I'm a Photoshop user so I couldn't think of anything quicker). Then I uploaded the video to imgur.
14
u/zcxhcrjvkbnpnm Jul 06 '15
I installed the package by ryankennedy following his instructions and it kind of worked. The last example of code provided in that Python Notebook launches a loop where the image is zoomed in slightly after each iteration and each frame is saved into a file.
I think the only alteration I made to that code was to change the file paths so that it loaded my image instead of the default one and saved the output frames in the same directory (/src/) instead of creating a new one somewhere.
Here's how the code looked (to be run after launching the four topmost code blocks in the Python Notebook, which are necessary to, umm, initialize the system):
After it rendered about a hundred frames, I joined them into a video using Photoshop (I'm sure it's not the most efficient/accessible solution, but I'm a Photoshop user so I couldn't think of anything quicker). Then I uploaded the video to imgur.