Code Monkey home page Code Monkey logo

ghc-face-detection's Introduction

Description

This repository is prepared for Grace Hopper Celebration workshop session: Confronting Algorithmic Bias in Artificial Intelligence. The repository contains implementation of mobilenet-ssd for face detection written in keras. The model training portion is borrowed from https://github.com/bruceyang2012/Face-detection-with-mobilenet-ssd

Required Software

Mac OS

Prerequisites

macOS 10.12.6 Sierra or above (Click Apple log in the top left corner and select 'About This Mac' to get the OS version)

Instructions

  1. Download and install Python3 from official site. If you already have existing Python3, please make sure the version is 3.6.5 by running 'python3 --version'

  2. Upgrade pip to the latest

python3 -m pip install --user --upgrade pip

  1. Install virtualenv

python3 -m pip install --user virtualenv

  1. Create a virtualenv

python3 -m virtualenv env

  1. Activating the virtualenv

source env/bin/activate

  1. Install required python packages

pip3 install keras tensorflow opencv-python jupyter imutils sklearn pillow beautifulsoup4 matplotlib tqdm

Troubleshooting steps

  1. If you see the following error, make sure the OS version is 10.12.6 or above. To check the version, click Apple log in the top left corner and select 'About This Mac'

ImportError: dlopen(/usr/local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation Referenced from: /usr/local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so (which was built for Mac OS X 10.12)

  1. If you do not see the live video window, wait for up to 10 seconds depending on the processing power of the laptop. It is possible that the window may be hidden.

  2. If you run into issues while running Jupyter notebook, please kill the Jupyter notebook and restart the virtualenv enviornment

Ubuntu

Prerequisites

Ubuntu 16.04 or above

  1. Install Python 3

sudo apt update && sudo apt install python3.6

  1. Install required python packages

pip3 install keras tensorflow opencv-python jupyter imutils sklearn pillow beautifulsoup4 matplotlib tqdm

Live Inference

The repository comes with a pre-trained model to detect faces from the webcam video. Follow the steps to run this inference

  1. Download or clone this repository by clicking the 'clone or download' button on this page.
  2. Unzip the downloaded zip file.
  3. Open a terminal and run the following command:

cd <download directory>

jupyter notebook

  1. Jupyter will open a new tab or window on your default browser. Click on 'live.ipynb', and click 'Run' on each cell to execute. Once you reach the last cell, wait a few seconds for a new window to open up. You can see the face detection in action!

  2. Press 'p' key on the video window to pause and 'Esc' key to stop the inference.

Challenges

  1. Count the number of people in the room.
  2. Capture any new face and save it as an image on local disk.
  3. Sound an alarm when an intruder is detected!

Training Model

This is outside the scope of the workshop and is included for the benefit of the audience and for the fullness of the workshop. Please refer to the original GitHub repository for more information on the training: https://github.com/bruceyang2012/Face-detection-with-mobilenet-ssd

License

MIT LICENSE

ghc-face-detection's People

Contributors

bruceyang2012 avatar vinayhanumaiah avatar zjuyang 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.