DEV Community

Cover image for πŸ€·β€β™‚οΈ How I trained a neural network to turn you into an Archer cartoon

πŸ€·β€β™‚οΈ How I trained a neural network to turn you into an Archer cartoon

Harrison Reid on May 14, 2020

A few weeks back I decided I wanted a cartoon version of my profile picture. Sadly, as I'm not much of an artist, drawing it myself was out of th...
Collapse
 
xazzzi profile image
Vitaliy

Is it temporally stable, i.e. can you turn video into reasonably good looking animation?

Collapse
 
harrison_codes profile image
Harrison Reid • Edited

(Edit: the GIF isn't coming up in the comment, so have added it to the post, near the top) Just a short one, but this worked pretty well. Technically the source for this was a GIF, not a video, but should work just as well for video. Again t is pretty hit and miss though - sometimes it seems to barely do anything all. Had to try a few to get one that turned out this well πŸ˜€

Collapse
 
harrison_codes profile image
Harrison Reid

Good question - I haven’t actually tried this yet, will give it a shot sometime today and post up the results. There are some demos on the CartoonGAN repo of some pretty good quality gifs that have been generated though, so I’m hopeful.

Collapse
 
waylonwalker profile image
Waylon Walker

This is so freaking cool, it needs to be a webapp!

Collapse
 
harrison_codes profile image
Harrison Reid

Thanks Waylon! I think I'll give this a shot - in theory it should be possible to convert it run entirely in the browser with no need for a backend. May be slow though... πŸ€”

Collapse
 
harrison_codes profile image
Harrison Reid

Now have it online running fully in browser at harrison.codes/cartoonify

Quite hackily put together and likely buggy, but working :)

Collapse
 
ben profile image
Ben Halpern

Really great to have the explanatory step by step here. Cool stuff Harrison.

Collapse
 
harrison_codes profile image
Harrison Reid

Thanks Ben πŸ˜€

Collapse
 
jess profile image
Jess Lee

This is so cool!

Collapse
 
harrison_codes profile image
Harrison Reid

Thanks Jess! 😁

Collapse
 
thijs0x57 profile image
thijs0x57

Nine Nine!

Collapse
 
tarise profile image
Nikki

This is impressive! Thanks for sharing.

Collapse
 
freddyhm profile image
Freddy Hidalgo-Monchez

Wow that's really awesome! Did you look into cloud services that can train the model for you? I've never used any but I've seen some ads for them.

Collapse
 
harrison_codes profile image
Harrison Reid

I did! Although not specifically with the cartoon-ifying part...

Basically I wanted to see if I could also trim the background out of the image (so I could overlay the cartoon-ified person onto a flat colour background or something like that), so spent a bit of time playing around with AWS Sagemaker, using their inbuilt semantic segmentation model. Haven't made much progress with that yet though...