Giter VIP home page Giter VIP logo

heimdall's Introduction

heimdall

A Tensorflow application to detect person alive by the camera using a Siamese Convolutional Net and LFW Dataset.

The heimdall is an application developed in Python version 3.7.9 64-bit.

Table of Contents

Install

Prerequisites:

Download and install Python 3.7.9, CUDA Toolkit 11.4 and cuDNN SDK 8.2.2.

NOTE: To run this application, it's recommended to have a GPU microprocessor and you should have a cam.

  • First, clone the repository:
git clone https://github.com/erickmp07/heimdall.git
cd heimdall

YOLO Proof Of Concept

  • Download the official weights pretrained on COCO Dataset here.

  • Save the file with the weights downloaded in the weights folder.

Then:

  • Install the dependencies with pip command:
pip install -r requirements.txt

Face ID project

  • Download the LFW Dataset here.

  • Save the TGZ file in the heimdall root path.

  • To skip the model training, you can download a model pretrained here.

  • Extract the model pretrained to the heimdall root path.

Then:

  • Install the dependencies with pip command:
pip install -r requirements.txt

Usage

YOLO Proof Of Concept

  • Load the pretrained weights and converts them to the Tensorflow format using the convert_weights.py script:
python convert_weights.py
  • The pattern command to run the video.py script is:
python video.py <iou threshold> <confidence threshold> <filename>

NOTE: The video.py script has a GPU check (recommended). So, if you don't have a GPU installed and want to run the model, comment this line at the script:

assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
  • Runs the model using one of following commands, for example:
python video.py 0.7 0.8 YOLOv3/data/videos/video01.mp4 # For video file input

or

python video.py 0.8 0.9 0 # For cam input

NOTE: Hit the "q" key to quit the detection.

Then, you can find the detections in the videos folder where the file name has the sufix "_detection" and the extension ".avi".

NOTE: Only one video can be processed at one run.

Face ID project

  • The pattern command to run the face_id.py script is:
python face_id.py <detection threshold> <verification threshold> <train flag> <test flag>

All the arguments are "optional" and the default values are:

detection_threshold = 0.5
verification_threshold = 0.5
train_flag = ''
test_flag = ''

The command below run the face_id.py script with the default values and DON'T train the model and DON'T make predictions with the test data:

python face_id.py

The command below run the face_id.py script with values to detection and verification thresholds, DON'T train the model and make predictions with the test data:

python face_id.py 0.8 0.7 '' test 

The command below run the face_id.py script with values to detection and verification thresholds, train the model and make predictions with the test data:

python face_id.py 0.8 0.7 train test 

After run one of the flavors of the face_id command, a dialog will open with your cam image. You should collect some positive (hitting the "p" key) and anchor (hitting the "a" key) examples. To quit the image collector, hit the "q" key.

Then, a new dialog will open with your cam image. Now, you can test the facial recognition. Hit the "v" key for verify if your face will be recognized or hit the "q" key for quit the recognition.

Known issues

  • When running the YOLO Proof Of Concept or the Face ID project, the TensorFlow may not find "cusolver64_10.dll". To solve this, rename the "cusolver64_11.dll" in the CUDA bin folder to "cusolver64_10.dll".

  • If your cam is being used by another task, an exception will be raised while the OpenCV tries to establish a connection with your cam. If possible, end the task that is using the cam and try again.

  • If you have more than one cam, the script may not find the correct cam while running. To solve this, change the value of the VIDEO_INDEX constant and try again.

Technologies

This project was developed with the following technologies:

Contributing

NOTE: This is a graduation project from the Computer Engineering course at PUC-Rio.

To ask a question, please contact me.

License

Licensed under MIT license.

heimdall's People

Contributors

erickmp07 avatar

Watchers

 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.