Skip to content
← Back to Community
Use a Machine Learning Model to create a Deep Dream!
Profile icon
hacker
has Hacker Plan
piemadd

About Me

Hello everyone, my name is Piero but since I don't post much here, you probably haven't heard of the things I've made, but I have a LOT of projects coming, so stay tuned!

EDIT Heres an example of what it can make: Video

Intro

Anyways, have you ever wanted to take an image and to see what a Machine Learning Model (created by Google!) thinks what a dream would look like with said image! Not only do I want to share my work, but also create a tutorial on how its done here. We'll be using a service called DeepAI, which comes with 10,000 free image processes! Beyond this, I highly reccomend you go check out the other ML Models which they have for use.

Steps

  1. Fork the Repl
  2. Go to deepai.org.
  3. Click on the Signup button.
  4. Once you have signed up and verified your email, go to your Dashboard and copy down the api-key.
  5. Go back to your repl in the sample.env file, and replace YOURTOKEN with the api-key you just copied.
  6. Change the filename from sample.env to .env. This will prevent people from seeing your api-key.
  7. In the images folder, upload an image with the name 0.jpg, this will be your starting image.
  8. At the top of the main.py file, you will see a variable by the name of FRAMES which you can change to the total amount of images you want to create.
  9. Now you can hit the Run button and wait until it completes!
  10. Now that you have your image sequence, you can use any tool of your liking to convert it into a video. Blender is a solid option, and there are plenty of tutorials online on how to use it, [like this one].

Closing

If you have any questions, feel free to mention me and I'll try to get back to you as soon as I can. I hope you enjoyed this little guide and I hope you'll enjoy my upcoming projects. Have a nice day!

Voters
Profile icon
SilvermoonCat
Profile icon
Polo1245Ofi
Profile icon
WILLIAMBAEWER
Profile icon
LuckyOreos
Profile icon
programmeruser
Profile icon
AaronPhilip
Profile icon
DungeonMaster00
Profile icon
HahaYes
Profile icon
seanlnge
Profile icon
HJK0000
Comments
hotnewtop
Profile icon
PowerCoder

image

Profile icon
piemadd

@PowerCoder
add print(j) before line 25 and send me the results. Chances are your email isn't verified.

Profile icon
MarcusWeinberger

Hey, cool project! The image doesn't seem to link to the video, though, so for anyone that wanted: https://www.youtube.com/watch?v=uY6rjXTHWyY

Profile icon
piemadd

@MarcusWeinberger
Whoops! I just replaced it, but thanks!