Share your repls and programming experiences

← Back to all posts
Don't Touch Your Face!
AlephZero (348)

Don't Touch Your Face!

Don't Touch Your Face is a website designed to help you break the habit of touching your face, to keep yourself and your surroundings safe of coronavirus. Here's a quick demo video:

How do I use it?

When you enter the website, teach the algorithm to recognize when you touch your face, by providing it with a few seconds of you touching your face and not touching your face. It only takes a few seconds, and then it should be good to go!

Once the algorithm is trained, it will alert you with a very annoying sound every time you touch your face. You can even leave it running in the background. Also, if you notice any mistakes, you can just train it again to add more data, and it should fix itself.

It will also collect stats of how much you're touching your face and display them to you, and show you random tips and facts about the coronavirus, to help you stay educated and up-to-date.


This project was created for the code jam, by Misha Farber Brodsky (@liltaco) and Maya Farber Brodsky (@AlephZero).

IMPORTANT: This is the build version, the source code is available here: We decided to upload the build just in case, because we occasionally got errors in development with the source code version.

The website is built using React.js, and the machine learning model powering it uses a technique called transfer learning, and is adapted from the algorithm powering Google's Teachable Machine - essentially, there is a pretrained ImageNet model that can already recognize pictures, and its second-to-last layer is feeded into a K-Nearest-Neighbors model, which is the only thing trained during execution. All the training happens right on your browser, and just with your face's data! Actually, the model isn't specific for face data, and can essentially be used for any type of classification.

MMN031 (6)

wow!! i like how it has tips and the screen turn red and makes a beeping sound when you touch your face. little laggy, though, but still really cool!!

11legos (3)

You should change the title attribute to "Touched!" So that the tab shows that you touched your face.

AlephZero (348)

@11legos Cool idea! I'll add it tomorrow.

11legos (3)

@AlephZero The sound idea is even better!

HarryPengRHS (11)

I told the algorithm that I'm touching my face when I'm not, and I'm not touching my face when I am. It's very interesting to see how the computer reacts. Good job!

AlephZero (348)

@HarryPengRHS Thanks! Yeah, actually the model isn't at all specific to touching your face, you can train it on anything you want.

Wilke000 (636)

When I press click here to enable camera it doesnt enable camera @AlephZero

AlephZero (348)

@IndyCarter Hmm that's odd, probably something with your browser's permissions - make sure that the site isn't blocked for some reason

Wilke000 (636)

I did it's allowed... still doesn't work @AlephZero :(

AlephZero (348)

@IndyCarter I wish I could help but I can't reproduce the issue on my computer.. Sorry!

vishal1999tk (11)

Wow, this is really cool! works as expected.

theangryepicbanana (1697)

Why submit the generated code instead of the real code? Code readability counts in the competition you know...

AdCharity (1322)

@theangryepicbanana literally what I was going to say

AlephZero (348)

@theangryepicbanana I have the source code here but I had some trouble running it, I'm getting all sorts of errors like "the build failed because the process exited too early", the errors don't appear consistently but I decided to upload the build just in case

theangryepicbanana (1697)

@AlephZero Ok. Just thought I'd point it out

TheDrone7 (1900)

Zwack said it won't count in this jam cuz the judge may or may not be familiar with the coding language used in the submission. @theangryepicbanana
DW, @AlephZero.