Share your repls and programming experiences

← Back to all posts
Use a Machine Learning Model to create a Deep Dream!
h
piemadd (49)

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!

Commentshotnewtop
piemadd (49)

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

MarcusWeinberger (585)

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

piemadd (49)

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