Professional Documents
Culture Documents
Mini Project
On
FACIAL RECOGNITION SYSTEM WITH VOICE
MESSAGE ENHANCEMENT
(Submitted in partial fulfillment of the requirements for the award of Degree)
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING
By
CH. LAKSHMI SRAVYA (187R1A0567)
S. THARUN (187R1A05B3)
P. RITHVIK (187R1A0581)
CERTIFICATE
The results embodied in this thesis have not been submitted to any other University or
Institute for the award of any degree or diploma.
Apart from the efforts of us, the success of any project depends largely on the
encouragement and guidelines of many others. We take this opportunity to express our
gratitude to the people who have been instrumental in the successful completion of this
project.
We take this opportunity to express my profound gratitude and deep regard to
my guide J.Narasimharao, Associate Professor for his exemplary guidance, monitoring and
constant encouragement throughout the project work. The blessing, help and guidance
given by him shall carry us a long way in the journey of life on which we are about to
embark.
We also take this opportunity to express a deep sense of gratitude to the
Project Review Committee (PRC) Dr. Punyaban Patel, Ms. Shilpa, Dr.M . Subha Mastan
Rao & J. Narasimharao for their cordial support, valuable information and guidance, which
helped us in completing this task through various stages.
We are also thankful to Dr. K. Srujan Raju, Head, Department of Computer
Science and Engineering for providing encouragement and support for completing this
project successfully.
We are obliged to Dr. A. Raji Reddy, Director for being cooperative throughout
the course of this project. We also express our sincere gratitude to Sri. Ch. Gopal Reddy,
Chairman for providing excellent infrastructure and a nice atmosphere throughout the course
of this project.
The guidance and support received from all the members of CMR Technical
Campus who contributed to the completion of the project. We are grateful for their constant
support and help.
Finally, we would like to take this opportunity to thank our family for their
constant encouragement, without which this assignment would not be completed. We
sincerely acknowledge and thank all those who gave support directly and indirectly in the
completion ofthis project.
i
LIST OF FIGURES/TABLES
ii
LIST OF SCREENSHOTS
iii
TABLE OF CONTENTS
ABSTRACT i
LIST OF FIGURES ii
LIST OF SCREENSHOTS iii
1. INTRODUCTION 1
1.1 PROJECT SCOPE 1
1.2 PROJECT PURPOSE 1
1.3 PROJECT FEATURES 1
2. SYSTEM ANALYSIS 2
2.1 PROBLEM DEFINITION 2
2.2 EXISTING SYSTEM 2
2.2.1 LIMITATIONS OF THE EXISTING SYSTEM 3
2.3 PROPOSED SYSTEM 3
2.3.1ADVANTAGES OF PROPOSED SYSTEM 3
2.4 FEASIBILITY STUDY 4
2.4.1 ECONOMIC FEASIBILITY 4
2.4.2 TECHNICAL FEASIBILITY 5
2.4.3 SOCIAL FEASIBILITY 5
2.5 HARDWARE & SOFTWARE REQUIREMENTS 5
2.5.1 HARDWARE REQUIREMENTS 5
2.5.2 SOFTWARE REQUIREMENTS 6
3. ARCHITECTURE 7
3.1 PROJECT ARCHITECTURE 7
3.2 DESCRIPTION 7
3.3 USE CASE DIAGRAM 8
3.4 CLASS DIAGRAM 9
3.5 SEQUENCE DIAGRAM 10
3.6 ACTIVITY DIAGRAM 11
4. IMPLEMENTATION 12
4.1 SAMPLE CODE 12
5. SCREENSHOTS 16
6. TESTING 19
8.1 REFERENCES 23
8.2 GITHUB LINK 23
v
1. INTRODUCTION
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
1. INTRODUCTION
This project has been developed to identify Deep learning based methods that
can extract more complicated face features. Deep learning is making crucial advances
in solving problems that have restricted the best attempts of the artificial intelligence
community for many years. It has proven to be excellent at revealing complex
structures in high-dimensional data and is therefore applicable to lots of domains of
science, business and government.
The main features of this project are that this model classifies the It addresses
the problem of learning hierarchical representations with a single algorithm or a few
algorithms and has mainly beaten records in image recognition, natural language
processing, semantic segmentation and many other real world scenarios. There are
different deep learning approaches like Convolutional Neural Network(CNN), Stacked
Autoencoder, and Deep Belief Network (DBN). CNN mostly used algorithms in image
and face recognition.
CMRTC 1
2. SYSTEM ANALYSIS
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
2. SYSTEM ANALYSIS
SYSTEM ANALYSIS
CMRTC 2
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
This project presents a system that recognizes people in video sequences using
image information. More specifically we are interested in locating shots where some
particular person appears in the image while talking, so that both face and voice are
out of use. Examples of these shots include taped footage of news anchors, and head
and shoulders sequences of people being interviewed. Moreover recording conditions
for this type of shots are usually more controlled, making the recognition task more
accurate.
● It accurates face detection fast enough and replays with voice output at
each time the recognised.
● Automated identification
● Easy to integrate
CMRTC 3
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
The feasibility of the project is analyzed in this phase and a business proposal
is put forth with a very general plan for the project and some cost estimates. During
system analysis the feasibility study of the proposed system is to be carried out. This is
to ensure that the proposed system is not a burden to the company. Three key
considerations involved in the feasibility analysis:
● EconomicFeasibility
● TechnicalFeasibility
● SocialFeasibility
The developing system must be justified by cost and benefit. Criteria to ensure
that effort is concentrated on a project, which will give best, return at the earliest. One
of the factors, which affect the development of a new system, is the cost it would
require.
The following are some of the important financial questions asked during preliminary
investigation:
● The costs conduct a full system investigation.
● The cost of the hardware and software.
● The benefits in the form of reduced costs or fewer costly errors.
Since the system is developed as part of project work, there is no manual cost
to spend for the proposed system. Also all the resources are already available, it give
an indication that the system is economically possible for development.
CMRTC 4
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on
the available technical resources. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this
system.
CMRTC 5
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 6
3. ARCHITECTURE
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
3. ARCHITECTURE
3.2 DESCRIPTION
This project is totally based upon identifying the recognised authorized faces.
The model is built to recognize faces as part of the biometric security system and then
produce a voice message for every recognized face. The model is built with libraries
like face recognition, pyttsx, os, opencv, pandas, numpy etc. Each library is used for a
specific purpose for example face recognition is used for face detection and
manipulation of images. The pyttsx library is used to convert text to speech which is
the reason the model produces voice output.
CMRTC 7
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
In the use case diagram, we have basically one actor who is the user in the
trained model.
A use case diagram is a graphical depiction of a user's possible interactions
with a system. A use case diagram shows various use cases and different types of users
the system has. The use cases are represented by either circles or ellipses. The actors
are often shown as stick figures.
Figure 3.2: Use Case Diagram for Facial Recognition System With Voice
Message Enhancement
CMRTC 8
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
Class diagram is a type of static structure diagram that describes the structure
of a system by showing the system’s classes, their attributes, operations(or methods),
and the relationships among objects.
Figure 3.3: Class Diagram for Facial Recognition System With Voice
Message Enhancement
CMRTC 9
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
Figure 3.4: Sequence Diagram for Facial Recognition System With Voice
Message Enhancement
CMRTC 10
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
Figure 3.5: Activity Diagram for Facial Recognition System With Voice
Message Enhancement
CMRTC 11
4. IMPLEMENTATION
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
import pandas as pd
import numpy as np
import face_recognition
import cv2
import os
import time
from utils import append_df_to_excel
import pyttsx3
engine = pyttsx3.init()
import datetime
video_capture = cv2.VideoCapture(0)
# Initialize some variables
known_face_encodings = []
known_face_roll_no = []
face_locations = []
face_encodings = []
face_names = []
process_this_frame = True
attendance_record = set([])
roll_record = {}
# Rows in log file
name_col = []
roll_no_col = []
time_col = []
df = pd.read_excel("student_db" + os.sep + "people_db.xlsx")
for key, row in df.iterrows():
roll_no = row['roll_no']
name = row['name']
image_path = row['image']
roll_record[roll_no] = name
CMRTC 12
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
student_image = face_recognition.load_image_file(
"student_db" + os.sep + image_path)
student_face_encoding = face_recognition.face_encodings(student_image)[0]
known_face_encodings.append(student_face_encoding)
known_face_roll_no.append(roll_no)
while True:
# Grab a single frame of video
ret, frame = video_capture.read()
# Resize frame of video to 1/4 size for faster face recognition processing
small_frame = cv2.resize(frame, (0, 0), fx=1, fy=1)
# Convert the image from BGR color (which OpenCV uses) to RGB color (which
face_recognition uses)
rgb_small_frame = small_frame[:, :, ::-1]
# Only process every other frame of video to save time
if process_this_frame:
# Find all the faces and face encodings in the current frame of video
face_locations = face_recognition.face_locations(rgb_small_frame)
face_encodings = face_recognition.face_encodings(
rgb_small_frame, face_locations)
face_names = []
for face_encoding in face_encodings:
# See if the face is a match for the known face(s)
matches = face_recognition.compare_faces(
known_face_encodings, face_encoding, tolerance=0.5)
name = "Unknown"
CMRTC 13
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
# Or instead, use the known face with the smallest distance to the new face
face_distances = face_recognition.face_distance(
known_face_encodings, face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
roll_no = known_face_roll_no[best_match_index]
# add this to the log
name = roll_record[roll_no]
if roll_no not in attendance_record:
attendance_record.add(roll_no)
x = datetime.datetime.now()
print(name, roll_no, x)
name_col.append(name)
roll_no_col.append(roll_no)
curr_time = time.localtime()
curr_clock = time.strftime("%H:%M:%S", curr_time)
time_col.append(curr_clock)
#cur = conn.cursor()
#cur.execute("INSERT INTO tblattendance (UserId, DateOfTransaction)
VALUES (%s,%s)", (roll_no,x)) #(Id) ) #, timeStamp
#conn.commit()
#cur.close()
engine.say(name)
engine.runAndWait()
face_names.append(name)
x = datetime.datetime.now()
#print (name, roll_no, x)
CMRTC 14
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 15
5. SCREENSHOTS
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 16
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 17
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 18
6. TESTING
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
6. TESTING
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs.
All decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .It is done after the completion of an
individual unit before integration. This is a structural testing that relies on knowledge
of its construction and is invasive. Unit tests perform basic tests at component level
and test a specific business process, application and/or system configuration. Unit tests
ensure that each unique path of a business process performs accurately to the
documented specifications and contains clearly defined inputs and expected results.
CMRTC 19
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
CMRTC 20
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
6.3.1 CLASSIFICATION
CMRTC 21
7. CONCLUSION
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
The potential benefit of using our trained model is that it can detect as many
faces at very fast rates and recognises the faculty, students and all other members
belonging to that particular institution or an organization. In addition to that particular
recognised face there is a voice message as the identity of any person who is
recognised with a welcome or a hello message with the identified persons name.
The potential idea behind the idea of the project is the additional feature,
“voice based output”, the future enhancement would be integrating with the video
sequencing. From this project the advancement to the facial recognition system can be
a great use in many applications like shopping malls, institutes, universities, home
applications. The model can effectively deliver voice messages to various faces and an
application to look out for.
CMRTC 22
8. BIBLIOGRAPHY
FACIAL RECOGNITION SYSTEM WITH VOICE MESSAGE ENHANCEMENT
8. BIBLIOGRAPHY
8.1 REFERENCES
[2] V. Bruce and A. Young, “Understanding face recognition,” Br. J. Psychol., vol.
77, no. 3, pp. 305–327, 1986.
[3] D. N. Parmar and B. B. Mehta, “Face Recognition Methods & Applications,” Int.
J. Comput. Technol. Appl., vol. 4, no. 1, pp. 84–86, 2013.
https://github.com/sravya666/Face-recognition-audio-output/tree/master
CMRTC 23