Giter Site home page Giter Site logo

peilingjiang-dev / secret_face Goto Github PK

View Code? Open in Web Editor NEW

This project forked from genekogan/secret_face

0.0 1.0 0.0 14.4 MB

Privately averaging everyone's faces together without sharing actual pictures

HTML 12.24% CSS 1.70% JavaScript 86.06%

secret_face's Introduction

Deploy

This node/express app demonstrates the simplest way of calculating the average of a dataset while keeping all of the underlying data private. The client application opens up your camera and starts taking pictures of your face, obfuscating the image by salting random zero-centered numbers to the pixels, then sending the garbled images to the server. The server then takes the average of all the images. With a large enough sample size, the added noise cancels out (converges to zero) and you're left with approximately the average of the actual non-obfuscated data.

example

Getting Started

  1. Install node and Heroku CLI.

  2. Clone the repo and install dependencies, then create heroku instance.

npm install
heroku create

Then whatever your app name is from Heroku, e.g. "cryptic-plains-03067"

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v160 -a cryptic-plains-03067

Also install python requirements.

pip install -r requirements.txt --user

  1. Upload to heroku web app.

    git push heroku master

  2. Start the python client which will collect the noisy images. Make sure to modify the HOST variable to your actual heroku url (e.g. https://cryptic-plains-03067.herokuapp.com/ for heroku).

python collector_client.py

  1. Visit your app on the web and put your face in the circle... It will take pictures, obfuscate the image, and send to the server. You should see images begin to show up in the images folder of wherever you are running the python client.

The app looks something like this:

app_screenshot

  1. Ideally you capture at least 1000 images. It works best with many clients (>20!) at same time in a room.

  2. Take the average of all the collected images.

    python calculate_avg.py

    And you will see a file myAverage.png show up in the root directory which contains the average.

secret_face's People

Contributors

genekogan avatar peilingjiang avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.