Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if iterator%1000 == 0:
- white_img = np.zeros([75,75,3])
- white_img.fill(255)
- white_img = np.expand_dims(white_img, axis=0)
- white_img += gradients * learning_rate
- min_pixel_white = white_img.reshape((white_img.shape[1]*white_img.shape[2], 3)).min(axis=0).min()
- max_pixel_white = white_img.reshape((white_img.shape[1]*white_img.shape[2], 3)).max(axis=0).max()
- original_white = white_img[0]
- original_white = (original_white - min_pixel_white) * (255/(max_pixel_white - min_pixel_white))
- im = Image.fromarray(original_white.astype(np.uint8))
- im = im.convert('LA')
- im.save("original_white"+str(iterator)+".png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement