Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Continue Iterations #18

Open
bitcoinissue opened this issue Jul 8, 2015 · 1 comment
Open

How to Continue Iterations #18

bitcoinissue opened this issue Jul 8, 2015 · 1 comment

Comments

@bitcoinissue
Copy link

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?

@ghost
Copy link

ghost commented Jul 12, 2015

There is a typo in the for loop that might be killing it. Specifically,

PIL.Image.fromarray(np.uint8(frame)).save("output/%04d.jpg"%frame_i)

should be (note that it went from output to outputs)

PIL.Image.fromarray(np.uint8(frame)).save("outputs/%04d.jpg"%frame_i)

This is what mine looks like, and it works:

111 frame = img
112 frame_i = 0
113
114 frame = deepdream(net, frame, end=json_data['layer'])
115 #frame = deepdream(net, img, end='inception_3b/5x5_reduce')
116 #frame = deepdream(net, img, end='conv2/3x3')
117
118 PIL.Image.fromarray(np.uint8(frame)).save("output.jpg")
119
120 h, w = frame.shape[:2]
121 s = 0.05 # scale coefficient
122 for i in xrange(100):
123     frame = deepdream(net, frame)
124     PIL.Image.fromarray(np.uint8(frame)).save("outputs/%04d.jpg"%frame_i)
125     frame = nd.affine_transform(frame, [1-s,1-s,1], [h*s/2,w*s/2,0], order=1)
126     frame_i += 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant