DEV Community

Harrison Reid
Harrison Reid

Posted on • Updated on

πŸ€¦β€β™‚οΈ Cartoonify Yourself!

Last week I wrote up a post about how I'd trained a neural network to "cartoonify" pictures of peoples faces.

I also made it available as a twitter bot (so you could tweet at me and have your profile pic cartoonified). I think about 30 or 40 people ended up using it to cartoonify their profile pics, which was a lot of fun πŸ˜€

Anyhow, I'm planning to retire the twitter bot soon (because πŸ’Έ) - but I've now converted the code to run entirely in the browser using tensorflow.js, and made it available online.

Check it out here.

Note: Currently doesn't seem to work reliably (or possibly at all) on mobile browsers - working on fixing this. Also, the cartoonifying effect tends to only work on relatively close up pictures of faces (presumably as thats what it was trained on). So feel free to play around with other kinds of images, but the results probably won't be great.*

Top comments (8)

Collapse
 
rahuldkjain profile image
Rahul Jain

Hi Harrison, I used Cartoonify on mobile phone. I uploaded an image and it got stuck showing cartoonifying. I waited for 4 mins, still no output. Please have a look into that

Collapse
 
sagartyagi121 profile image
Gajender Tyagi

Same issue

Collapse
 
harrison_codes profile image
Harrison Reid

Thanks for the heads up! Will look into this...

Collapse
 
devhammed profile image
Hammed Oyedele

I was about to say this too.

Collapse
 
pandaquests profile image
Panda Quests

Same

Collapse
 
sachinjain024 profile image
Sachin Jain

Hey Harrison, I uploaded a pic and it just kinda blurred the image. Nothing else.

Collapse
 
harrison_codes profile image
Harrison Reid

Hmmm interesting - was the picture you selected a portrait style image of a face? As a general rule, it seems to perform best with well lit, relatively close up portrait style images of faces (Presumably because I trained the model with faces). It generally doesn't seem to do much to other styles of image unfortunately...

Collapse
 
herawais profile image
Muhammad Awais

Chrome Tab Crashes