Skip to content

Securely blur faces in videos before uploading to social media applications

Notifications You must be signed in to change notification settings

aebenw/the-face-blur

Repository files navigation

Flask app to handle Blob uploads of MP4 files/images.

Flow

  • User makes a network request to application with a Blob file as the body of the request
  • The applicaiton keeps the request open, reads the blob, and saves the mp4 locally on the server _ blur_face_video.py scripg gets trigger and breaks up mp4 frame by frame
  • Runs a model to find a face in the frame, blurs the face and writes new images into a new mp4
  • Server sends back the new mp4 and deletes the original

Setting up Flask

  • Make sure pip3 and python3 are set up on your computer
  • Activate the virtual environment to set up the python interpreter
sh venv/bin/activate
  • Install requirements from requirements file
pip3 install -r requirements.txt
  • Export the name of the flask server file in your terminal session
export FLASK_APP=fb_server.py
  • Run the server
python3 -m flask run

This should activate the server on port 5000

Setting up Docker

  • Run docker build -t faceblur .
  • After the image has built, run docker run -p 5000:5000 -it faceblur
  • The container should be serving over localhost 5000

To Do

  • Deblob object send to pyscript
  • Send data back as blurred video
  • Create DockerFile for server code
  • Set up ALB (with https) or APIGW to ping Server
  • Set up CORS with app ID on either the server, the ALB or Both

About

Securely blur faces in videos before uploading to social media applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published