Has science gone too far? Inspired by Janelle Shane (aka @lewisandquarkâ), Iâve taught a neural network how to draw my cat Mulder. The results are ... delightfully off-kilter.
Hereâs what the process started with:
Hereâs the ALARMING midpoint:
And here, after 3,000 iterations, is the rather impressive result!
The process is actually easy enough a non-computer-geek like me could figure it out â thereâs no coding involved, nor do you need a ton of computing power. All you need is a video of your pet (or whatever you want to see AI try to recreate), and two pieces of free software: VLC Media Player and RunwayML.
DETAILED TUTORIAL BELOW THE CUT... If you use it, please reblog this post with your results -- Iâd love to see âem! Note: Iâm a Windows user; the process for Mac might be slightly different at some steps.
Step One: Gather your dataset
In order to train an AI, youâll need to feed it a sampling of 500-5,000 relevant images. Rather than take all those pictures individually, weâre going to use VLC Media Player to extract the frames from a video you take.
1. Record a roughly two-minute video of your subject (eg., your own cat, a mushroom, your mug collection, your own face if youâre really brave, whatever). The subject should be centered in the frame. For the best (most coherent) results, youâll want good lighting and contrast, for your subject to remain relatively stationary.
2. Download the video onto your computer from Google Photos or whatever cloud service your phone backs up onto.
3. Download and install VLC Media Player. If you already have VLC Media Player, ensure youâre running the most recent version by clicking âHelpâ and then âCheck for updates.â
4. Run VLC Media Player as administrator. (Right-click the shortcut on your desktop or in the start menu and select âRun as administrator.â)
5. Hit ctrl+P in VLC to open your preferences menu. In the bottom lefthand corner of the menu, youâll see the words âShow Settingsâ and the options âSimpleâ and âAll.â Select the âallâ option. You should see this:
6. In the menu on the left, scroll down to the bottom and click on âFiltersâ (not the â>â sign next to Filters, but the word itself.) Find âScene video filterâ and tick the box, as shown:
7. On your computer, prepare the file where you want those frames to go once VLC extracts them. I just created a new file on my desktop named âMulder frames.â Double-click the file to open it, then in the navigation bar, click the dropdown to show the whole file path. Itâll be something like C:\Users\elven\Desktop\Mulder frames. Ctrl+C it.
8. Back in VLC, in the menu on the left, expand the Video>Filters submenu by clicking the > button next to Filters. Scroll down til you see âScene filterâ and click that to open its settings. In the âimage formatâ field, input âjpgâ or âpngâ.
9. In the âdirectory path prefixâ field, paste in the file path from above.
10. Then, choose your ârecording ratio.â If you put in 1, VLC will extract every single frame from the video. If you input 3, itâll be 1 in 3, and so on. If your videoâs on the short side, youâll probably want to grab every frame. I went with 1 in 3.
11. DONâT CHANGE ANYTHING ELSE in this menu. Youâll especially want to avoid ticking the âalways write to the same fileâ box -- thatâll just overwrite the same frame over and over again. (Yeah, I did that to myself.) Your settings should end up looking like this:
12. HIT SAVE.
13. Hit Ctrl+O and select your video. VLC will extract the frames automatically as it plays. Open the destination file you set up earlier -- it should be filled with hundreds of pictures. (Once thatâs done, if you intend to continue using VLC, make sure to open settings again and UNTICK the âScene video filterâ box you ticked in #6. Otherwise, VLC will continue extracting frames from every single video you watch.)
Step 2: Set up your experiment
1. Download and install RunwayML.
2. Launch RunwayML. Create your account, then dismiss whatever âwelcome to the programâ-type popup it gives you.
3. In the lefthand column, click the button that looks like a lil wiggle. That should open this page:
4. Click âTrain a new image model,â name your experiment, and click âCreate.â
5. Itâll prompt you to select a dataset. Click the first box, with the + symbol, and navigate to the file of frames you made earlier. Select it and wait for it to upload. (If your file is larger than 5GB, youâll have to delete some of the images.)
6. Click next. Thatâll take you to âSetup.â This is where you choose a model someone else has trained as a starting point for your own model -- itâs faster to teach a Neural Network how to turn, say, human faces into cats than it is to teach it to make cats from scratch. I suggest just leaving the settings as-is, though if you want you can click âchangeâ and browse other models.
7. Click âstart training.â
Step 3: Enjoy what thou hath wrought
1. Be patient while RunwayML runs the experiment. It took about 3 hours for mine to wrap up. While you wait, you can watch the progress in Runway. Donât worry about missing something -- youâll be able to go back to this experiment and review the whole training process whenever you want. The FID score on the right should slowly count down -- the closer it gets to 0, the closer the AIâs generated results are to the dataset you gave it.
2. Once your experiment is complete, you can use the slider to move back and forth through the training steps. Click the âsave sample imageâ button to save steps you find particularly entertaining, or hit the âcreate progress videoâ button and Runway will generate a video of the whole process.
3. Click âNext.â Thatâll take you to this screen, with a gif of the final product and a few other options.
4. Click âsave videoâ so you can look back at your freaky AI-rendered pet whenever you want. (Thatâs mine at the top of the page.) From here, you can also generate more sample images using the model youâve just trained.
Congrats! You did it! Now try not to see the results in your nightmares!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
â Live Streamingâ Interactive Chatâ Private Showsâ HD Quality
Anya is LIVE right now
FREE
Free to watch ⢠No registration required ⢠HD streaming
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
â Live Streamingâ Interactive Chatâ Private Showsâ HD Quality
Anya is LIVE right now
FREE
Free to watch ⢠No registration required ⢠HD streaming