Skip to content

abdimk/facial_analysis

Repository files navigation

Real-time Facial Recognition Based Attendance and Activity Tracking System

The Architecture

This repository contains the Setup and Configration for activity and facial recogniton attendance system.

Introduction  •  Installation  •  Usage  •  Documentation  •  Issue?

Introduction

This repository provides simple APIs/functions/methods to work with svm facial recogniton You can:

  • Reconize faces using svm Classification [Tensorflow](for Future)
  • Able to take live stream feeds from multiple cameras at the same time using Kafka
  • Fetch historic data on kibana
  • Fetch assocated details from the sqlite database
  • Generate Historical report using csv
  • Able to run on distributed system/cluster nodes

Face recognition Process using svm(support vector machine) clssification

Face Recognition Process

System Dependencies

you need to Install those dependency for your os to run this system !

  • Kafka - is a distributed event streaming platform used for building real-time data pipelines and streaming applications.
  • ElasticSearch -is a distributed, RESTful search and analytics engine built on top of Apache Lucene.
  • Kibana - Kibana is an open-source data visualization and exploration tool for Elasticsearch.

Usage

clone the github repo

git clone https://github.com/abdimk/facial_analysis

install the python libraries need

pip3 install -r requirements.txt

record a user using either Register or our new customRegister

run one of these apps using

python3 customRegister.py

it capture 5 images for a singe individual and stores it on the DataBase folder

encode the face and thier names

python3 Model/cpuModels/encode_faces.py

Start the system

run the kafka producer

python3 Kafka/producer.py

start the utilities as one

python3 control/start.py

cd to the model

the run the main.py

python3 Model/main.py

stop all with

python3 control/stop.py

Installation

How do i install kafka  •  Elastic Search installtion  •  Kibana installation

kafka

installing kafka for ubuntu 22.04 >

To update the system packages

sudo apt get update

you can install OpenJDK 8 or OpenJDK 11

sudo apt install openjdk-8-jdk

or

sudo apt install openjdk-11-jdk

you also need to add java home to your path/bashrc file

sudo nano ~/.bashrc

then add this

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 
export PATH=$PATH:/usr/lib/jvm/java-11-openjdk-amd64/bin 

update the path

sudo source ~/.bashrc

download kafka binary

To download the Kafka binary from offical website. Please use this Kafka official download page and to prompts to download page and you can download Kafka using wget

sudo wget https://downloads.apache.org/kafka/3.8.0/kafka_2.13-3.8.0.tgz

Step #1:Install Apache Kafka on Ubuntu 22.04 LTS

Now to un-tar or Unzip the archive file and move to another location:

sudo tar xzf kafka_2.13-3.8.0.tgz
sudo mv kafka_2.12-3.5.0 /opt/kafka

Step #2:Creating Zookeeper and Kafka Systemd Unit Files in Ubuntu 22.04 LTS

Create the systemd unit file for zookeeper service

sudo nano  /etc/systemd/system/zookeeper.service

paste the below lines

/etc/systemd/system/zookeeper.service
[Unit]
Description=Apache Zookeeper service
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=simple
ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties
ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Reload the daemon to take effect

sudo systemctl daemon-reload

Create the systemd unit file for kafka service

sudo nano /etc/systemd/system/kafka.service

paste the below lines

[Unit]
Description=Apache Kafka Service
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service

[Service]
Type=simple
Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
ExecStop=/opt/kafka/bin/kafka-server-stop.sh

[Install]
WantedBy=multi-user.target

Reload the daemon to take effect

sudo systemctl daemon-reload

Step #3:To Start ZooKeeper and Kafka Service and Check its Status

Lets start zookeeper service first

sudo systemctl start zookeeper

Check the status of zookeeper service if it started

sudo systemctl status zookeeper

Start the kafka service

sudo systemctl start kafka

Check the status of kafka service if it started

sudo systemctl status kafka

About

Facial Recognition Attendance System and Activity Tracking that can work with multiple cameras

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors