Code Monkey home page Code Monkey logo

weblineindia / aiml-pupil-detection Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 11.0 96.27 MB

The Pupil Detection AI ML program is used to get the co-ordinates of eyes and detect the pupil region. It only works with human face images.

Home Page: https://www.weblineindia.com/communities.html

License: MIT License

Python 100.00%
aiml ai-ml artificial-intelligence machine-learning artificial-intelligence-algorithms pupil-detection aiml-pupil-detection face-detection face-detection-using-opencv eye-detection

aiml-pupil-detection's Introduction

Pupil Detection using Dlib face landmark detector

The code is used to get the co-ordinates of eyes and detect the pupil region accurately.

It works with human face images. Dlib's facial landmark detector is used for extracting the coordinates from the eye region. The eye corner points are collected and it check for dark colored region between the detected eye corner points of each eye. It uses OpenCV's houghcircles for detecting circle in a gray scaled image. Thus the pupil is calculated as the midpoint of the circle.

Table of contents

Getting started

Prerequisites for running the code are:

  • Python = 3.5
  • python-opencv = 4.2.0

We have tested our program in above version, however you can use it in other versions as well.

Installation

From terminal run this

pip install numpy
pip install imutils
pip install scikit-image
pip install argparse
pip install opencv-python
pip install opencv-contrib-python

dlib installation for ubuntu

Step:1

pip install dlib

If above command doesn't work then follow below steps

Step:2 Install system dependencies

sudo apt-get install -y --fix-missing \
    build-essential \
    cmake \
    gfortran \
    git \
    wget \
    curl \
    graphicsmagick \
    libgraphicsmagick1-dev \
    libatlas-dev \
    libavcodec-dev \
    libavformat-dev \
    libgtk2.0-dev \
    libjpeg-dev \
    liblapack-dev \
    libswscale-dev \
    pkg-config \
    python3-dev \
    python3-numpy \
    software-properties-common \
    zip \
    && apt-get clean && rm -rf /tmp/* /var/tmp/*

Step:3 Clone dlib

git clone -b 'v19.9' --single-branch https://github.com/davisking/dlib.git
cd dlib

Step:4

Run below command if system supports AVX instructions

sudo python setup.py install --yes USE_AVX_INSTRUCTIONS

Or

sudo pyhton setup.py install

Features

  • Accurately detects the eye pupil on human face.
  • HoughCircles is used to detect circles.

Usage

Inside the project directory run:

python pupil_detection.py -i path-to-directory-of-input-images -o path-to-output-directory

You can find sample images in image folder and result images in output folder.

Results

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Need Help?

We also provide a free, basic support for all users who want to use this AI ML based pupil detection techniques for their projects. In case you want to customize this Pupil detection technique for your development needs, then feel free to contact our AI ML developers.


Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Credits

Refered dlib face detection lib Dlib.

License

MIT

Keywords

Pupil-detection, face-detection, eye-detection, opencv-image-processing, dlib, HoughCircles, artificial-intelligence, machine-learning, ai-ml

aiml-pupil-detection's People

Contributors

partners-wli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.