Professional Documents
Culture Documents
In Partial Fulfillment
of the Requirements for the Degree
BACHELOR OF SCIENCE IN COMPUTER ENGINEERING
By:
May 2022
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
APPROVAL SHEET
This thesis entitled
prepared and submitted by Francis Rae R. Cillo, Mark Jason M. Conte and
Drake Joshua J. Besario has been examined and is recommended for approval and
acceptance for
ORAL EXAMINATION.
_______________________________ _______________________
Member Member
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
Certificate of Originality
This is to certify that this research paper is our work and does not contain any
substantial extent has been accepted for the award of any degree of diploma in Saint Paul
University Surigao, and other educational institutions, except where due acknowledgment
is made in the thesis. Any contribution made to the research by others, with whom we
the thesis.
Date: _________________
Attested by:
Engr. Angelus Vincent P. Guilalas
Adviser
Date: __________
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
ACKNOWLEDGEMENT
The researchers would like to express the following individuals for their
assistance to the success of this thesis. First and primarily, the God Almighty, for his
endless support and encouragement, offering them with strength and perseverance
through hard moments, as well as wisdom and understanding to ensure the success of this
project and providing them with the necessities; Their parents for their unending support,
particularly in terms of cash, love and understanding, counsel and messages of support
that bolstered their spirits to continue pushing despite the struggles and problems they
endured;
Engr. Angelus Vincent Guilalas, research adviser and research instructor, for his
noteworthy and effective teaching in developing this project and for his teaching about
the process and for motivating the researchers for success which greatly helps throughout
the research. To their beloved friends, who extended their support by sharing their
knowledge, ideas and suggestion; To the faculty of Saint Paul University Surigao and to
those who were not mentioned but have directly and indirectly contributed their
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
ABSTRACT
the pandemic virus. The risks of virus spread can be minimized by avoiding physical
The purpose of this project is, to produce a system for social distance monitoring
using an overhead perspective combining the advanced detection algorithms, this method
Environment (IDE) and Python 3.10 language. During this way, the detection uses pre-
trained algorithm using an overhead human data set. We used an approximate distance of
or not the distance value breaches the minimum social distance threshold, additionally, a
tracking algorithm is employed to detect individuals in video sequences, specified the one
that violates and crosses the social distance threshold is also being mark and send an
alarm sound through the speaker. Experiments are distributed video sequences to check
the accuracy, precision and sensitivity of the system. Findings indicate that the developed
system successfully distinguishes the accuracy of the program in detecting the social
3.10
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
TABLE OF CONTENTS
Page
TITLE i
APPROVAL SHEET ii
ACKNOWLEGDGMENT iv
ABTRACT v
TABLE OF CONTENTS vi
CHAPTER 1
CHAPTER 2
REVIEW OF RELATED LITERATURE 20
Synthesis of the Review 23
CHAPTER 3
METHOD 24
Research Design 24
Hardware Design 25
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
Software Design 26
Data Gathering Procedure 31
Setting 33
Statistical tool 34
CHAPTER 4
RESULTS AND DISCUSSION 38
Technical Specification 38
Result 41
CHAPTER 5
Summary 54
Findings 55
Recommendation 55
Conclusion 57
REFERENCES 58
APPENDICES
A Letter for Adviser 61
B Letter of the Request to Conduct the Study 62
C Program code 63
CURRICULUM VITAE 76
LIST OF FIGURES
FIGURES
1. Conceptual Diagram 12
2. Flowchart of the study 13
3. System Overview 25
4. Person Detection 26
5. Distance Measuring 27
6. Euclidean Diagram 28
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
7. Distance Calculation 28
8. Flowchart of the system 30
9. Data gathering 32
10. Scenario 1> meter 41
11. Scenario <1 meter 44
12. Classroom conducted project 49
13. Monitoring Social distance in the conducted area 50
LIST OF TABLES
1. Table 1 Hardware components 38
2. Table 2 System Input 39
3. Table 3 Scenario of >1 meter 43
4. Table 4 Scenario of <1 meter 46
5. Table 5 Accuracy Calculation 47
6. Table 6 Precision Calculation 48
7. Table 7 Recall Calculation 48
8. Table 8 Accuracy Calculation 51
9. Table 9 Precision Calculation 52
10. Table 10 Recall Calculation 53
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
CHAPTER 1
worldwide since December 2019. On March 11, 2020, the World Health Organization
(WHO) announced a pandemic disease as the virus spread through 114 countries, caused
4000 deaths and 118,000 active cases (WHO; W.H. Organization, 2020). On October 7,
2020, they reported more than 35,537,491 confirmed COVID-19 cases, including
1,042,798 deaths. According to data obtained by the World Health Organization (WHO),
the world pandemic of COVID-19 has severely impacted the planet and has now infected
over eight million people worldwide. Wearing face masks and following safe social
distancing are two of the improved safety protocols that require to be followed publicly
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
10
places so as to stop the spread of the virus. to make a secure environment that contributes
the number of cases and death in COVID-19 are increasing due to the people who did
not follow the safety protocols, following the announcement of limited face to face class
other degree programs that require hands-on experience in Higher Education Institutions
(HEIs)
The urgent need for hands-on experience and the safety of students taking up medicine
and allied health courses, who were permitted by the national government to conduct
limited face-to-face classes since January 2021, is the key for CHED to recommend on
The designed project Social Distance Monitoring with Alarm for the limited face-
to-face class is a system to distinguish between individuals to make sure social distance is
being followed and to slow down the spread of infectious diseases. In this project, the
researchers will implement social distancing monitoring, the researcher will apply object
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
11
detection (for person class) to detect all people and then apply distancing measures (N
pixels.) to monitor the distance between people. Also, by putting an alarm for the system
specific area or room and prevent getting contact with a virus and to make use of this
The proposed project helps to ensure the student's safety by automatically monitoring
whether they maintain social distance. It anchors on the use of computer vision for
two modules, person detection and social distance monitoring. The top view installed a
camera capturing images from space and processed to the human detection module; the
human detection module utilizes detects human bounding boxes. The bounding box
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
12
information is further utilized by a social distance monitoring module that identifies the
SYSTEM
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
13
Figure 1. Ddisplays the flow of the study. The input box represents the list of
materials and tools being used including the needed data. To identify individuals, the
design project employs a camera and a personal computer loaded with Pycharm, an
well as a speaker that emits a beep sound whenever people exceed the safe distance.
Hardware
Planning and
Requirements:
brainstorming
Laptop or Personal
Social Distance
Computer Selection of algorithm
Monitoring With
Web Camera
Determining the Scope
Speaker Alarm System For
of the Study
Software
Limited Face to
Requirements: Recognition of the
Face Classes in
Pycharm (IDE) Problems and
Covid-19
Language: limitations
Data:
` Camera
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
14
Accuracy Precision
Sensitivity
this, we are developing a system that creates the use of Pycharm as an Intergrated
Development Environment (IDE) and python 3.10 programming language to achieve the
Specific Objective:
1. To design and develop a system that monitors the social distancing during the
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
15
2. To design and develop a social distancing system using Pycharm and Integrated
4. To evaluate the system’s performance and test the design project to a school
Assumptions
For the Social Distancing Monitoring System to efficiently work there are crucial
assumption were made.
In the process of implementing the designed project the researcher assumed that:
• Develop a real-time based detection system.
This research will provide deep learning method and an advanced way for
monitoring for the safety of any individuals and to ensure the safety protocols in this time
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
16
Educational Institutions: Due to the global immunization, some of the area with a
decreasing number of virus cases is announcing to open the schools for limited face to
face classes. In helping to ensure the safety of the students this research will help
monitoring the students to always follow the safety protocols, and to prevent possible
Public Establishment: Due to the lightening of the quarantine many establishments are
now open for business, this will also beneficial to monitor the crowd for a specific
system this will inform not only individually but the people in the entire area.
Government Agencies: This research will also help in the contact tracing; agencies will
easily know where, when and how the outbreak started and also due to its surveillance
system it can be install in any specified location to monitor the pedestrians and any
overcrowded places.
Community: One of the major priorities of this research is to help the people to always
ensure their safety in any kinds of activity, and to remind that even the quarantine is
minimized the virus is always there, people need to always follow what are the safety
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
17
This study is focused on a system that will automatically alert when someone is
not observing social distancing. The major operation and development system is to help
The Social Distance Monitoring with Alarm System in Limited Face to Face
This project is restricted to the campus area, using the camera it will monitor an
The designed project will only detect the persons violating social distancing, it
will not recognize any object or an animal, it only applies to humans. This project will be
Definition of Terms
For a greater understanding of this study, the following terms are defined in the
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
18
text form. A monitor usually comprises a visual display, some circuitry, a casing, and a
Social Distancing - in public health, social distancing, also called physical distancing, is
contagious disease by maintaining a physical distance between people and reducing the
number of times people come into close contact with each other. [5]
a set of rules to form a unified whole. A system, surrounded and influenced by its
environment, is described by its boundaries, structure and purpose and expressed in its
functioning. [7]
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
19
Computer vision - Computer vision is an interdisciplinary scientific field that deals with
how computers can gain high-level understanding from digital images or videos. From
Real-time - the actual time during which a process or event occurs. [11]
Computer - an electronic device for storing and processing data, typically in binary
Alarm system - Alarm system means a device or series of devices, which emit or
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
20
CHAPTER 2
a safe distance between yourself and other people who aren’t from your household. The
virus cases increase among people who are in close contact for a long period of time, the
spread happens when an infected person has cough, cold and other flu-like symptoms as
the droplets from their mouth or nose launched into the air and lands into the face of
people nearby and for that reason why masks is important but masks alone will never
protect against the virus. To maintain or practice social distancing, people should stay at
least 1 meter away from other people and avoid contacting people in crowded places.
[15]
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
21
Person detection
Based on the study of the problem of detecting and tracking people in crowded
video scenes. While detection of individual objects has greatly improved in recent years,
crowd scenes remain particularly difficult for detection and tracking tasks due to heavy
address these issues, proposed leveraging information about the overall structure of the
scene and resolving all detections jointly. Investigated crowd density constraints in
particular, and formulate person detection as the optimization of a joint energy function
how the optimization of such an energy function significantly improves person detection
According to under the three-year Video Surveillance and Monitoring (VSAM) project
(1997--1999), the Robotics Institute at Carnegie Mellon University (CMU) and the
Monitoring. The technical approach uses multiple, cooperative video sensors to provide
continuous coverage of people and vehicles in a cluttered environment. This final report
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
22
presents an overview of the system, and of the technical accomplishments that have been
achieved. [17]
Alarm System
In the first stage, an approximate median method is used to segment moving regions in a
video frame. In the second stage, a fuzzy c-means (FCM) method is used to cluster
candidate smoke regions from these moving regions. In the third phase, a parameter
extraction method is used to extract a set of parameters from spatial and temporal
vector, surface roughness and area randomness of smoke. In the fourth stage, the
parameters extracted from the third stage are used as input feature vectors to train
a support vector machine (SVM) classifier, which is then used by the smoke alarm to
make a decision. Experimental results show that the proposed four-stage smoke-detection
smoke detection, providing a low false-alarm rate and high reliability in open and large
spaces. [18]
Social Distance
An artificial intelligence network-based smart camera system prototype has been built in
this study, which measures social distance from a bird's-eye perspective. To recognize
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
23
"Faster-R-CNN ResNet-50" models have been used. The final prototype, which is based
on the Faster R-CNN model, is an integrated embedded system that uses the camera to
measure social distance. The program, which was created with the "Nvidia Jetson Nano"
development kit and the Raspberry Pi camera module, does all necessary calculations,
identifies social distance violations, issues auditory and visual warnings, and sends the
findings to the server. The designed smart camera prototype is expected to be integrated
into public places as part of the world's transition to "sustainable smart cities." [19]
The above literature discussed about social distancing for COVID-19 that provides
information to the proponents that their proposed study that has similarities with other
system which is widely used. The ideas presented by the cited authors give the
researchers pattern for the architecture and algorithm of the study. As stated, the system
discussed in the readings is like that of this study in terms of the functions of the system.
They also shared the same idea in the purpose for which the system was made, that to,
automatically monitor social distancing with alarm. They differ in application used and
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
24
CHAPTER 3
METHODOLOGY
Face Classes for COVID-19, this study will utilize a descriptive research approach.
situation, or phenomena, and the development of a designed system for all the people of
RESEARCH DESIGN
This study used of descriptive and developmental research design since the design
considered necessary for testing, observing without changing the quantitative data and
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
25
documenting the results. Also, the researchers will employ surveys in the area where a
The study is a developing system for social distance monitoring by using Python
programming language with different python package and libraries, Pycharm IDE to the
camera to be able to detect people individual distance and with an alert sound, to politely
Hardware Design
The hardware design is the physical and external composition of the system. It consisted
of the components that were interconnected and used in the project design.
SYSTEM OVERVIEW:
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
26
Assuming that two people are in close proximity. If they cross the acceptable
social distance threshold our camera will respond by sending the detected people to the
System, where our code resides. The code will wait for the moment when the social
distance threshold has been violated and immediately sound an alert to a loud speaker,
Software Design
The proponents used a Python, Pycharm and camera to capture people in specified area,
the image is parsed to detect people in the image. Upon detection the depth info is also
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
27
Person Detection
Looking in Figure 1 We can see here that if the camera will capture any individual person
it will notify the system and it will automatically marked as a person by putting a
rectangular shape. This is important for the system to know that it will automatically
recognize a person.
Distance Measuring
In Figure 5 It’s easier to imagine the position of people in stick figure, taking only the X
and Y coordinates into account. This perspective makes it possible to use a Euclidean
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
28
formula for distance calculations and can be useful to understand how the camera is
determining out position in space. Knowing each person’s position, we can now calculate
the distances between them and check if they do not exceed the defined threshold.
1meter
Distance
x,y x,y
Distance Calculations
Euclidean Formula
Frame 1
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
29
In Fig 6 Frame 1, Assume this is a video frame captured by a camera; the algorithm will
create a rectangle box, with the 2 centroid measuring the distance between a human and
the camera.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
30
In the next frame 2 the purple circle represents the previous centroid, while the yellow
circle represents the new centroid. If the yellow person moves closer to the purple person,
we can use the Euclidean formula to calculate the distance between them.
To compute the distance between the 2 centroid of the bounding box, using Pycharm and
a pre-built package of Euclidean formula to measure the distance between two bounding
boxes. The social distancing measurement in the video frame detected by the camera is
50 pixels.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
31
Figure 2 shows the flow of the project design, it first access video stream from the
camera, ensures that at least two people detected in the video in order to compute
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
32
pairwise distance. If no one is violating social distance, a green bounding box will
appear; if someone is violating social distancing a red bounding box will appear along
This section shows the flow of gathering data relevant on the research study. The
school where face to face classes is implemented. Upon approval of the said request, the
researchers conducted an observation within the room by setting-up the computer and the
camera and with the use of the system the researcher can now gathered and analyze the
data.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
33
STARTT
REQUEST INSTALLATION
OF CAMERA
IMPLEMENTATION OF THE
PROJECT
TESTING PROJECT
PERFORMANCE
VALIDATION OF RESULTS
END
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
34
SETTINGS
In choosing the setting of this study, the researchers will choose a school where
DATA ANALYSIS
The following were the data’s needs to be processed and also used to help in the analysis:
Block Diagram. It consisted of the components that were interconnected and used in the
project design.
Flowchart. This shows the flow of the designed project on processing the data from the
sensors used.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
35
Statistical Tool
Confusion Matrix
A confusion matrix is a table that is used to define the performance of a classification
classification algorithm.
Predicted
Actual Negative Positive
Negative TN FP
Positive FN TP
Confusion matrices represent counts from predicted and actual values. The output “TN”
stands for True Negative which shows the number of negative examples classified
accurately. Similarly, “TP” stands for True Positive which indicates the number of
positive examples classified accurately. The term “FP” shows False Positive value, i.e.,
the number of actual negative examples classified as positive; and “FN” means a False
Negative value which is the number of actual positive examples classified as negative.
One of the most commonly used metrics while performing classification is accuracy. The
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
36
accuracy of a model (through a confusion matrix) is calculated using the given formula
below.
Accuracy = TN+TP
TN+FP+FN+TP
Recall:
A recall can be defined as the ratio between the total number of positive
examples correctly classified and the total number of positive examples. High Recall
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
37
Precision:
number of FP).
High recall, low precision: This means that most of the positive examples are
correctly recognized (low FN) but there are a lot of false positives.
Low recall, high precision: This illustrates that a lot of positive examples (high FN)
are missing, but those we expect are actually positive ones (low FP)
F-measure:
reflects both of them is helpful. We compute an F-measure that uses Harmonic Mean
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
38
The F-Measure Has always been closer to the lesser value of Precision or Recall.
CHAPTER 4
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
39
This chapter presents the documented design project based on input, process and output.
Technical Specification
Hardware Components
TABLE 1
Components Specification Picture
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
40
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
41
Argparse
Imutils
Os
Scipy
Distance
Yolo
TABLE 2
System Input
The design project is powered by a computer with installed camera and speaker. The
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
42
RESULT
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
43
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
44
Table 3
The researcher run a test in a system to get the result of accuracy in > 1 meter by using
confusion matrix in different position, by manually calculating the data gathered from the
system in
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
45
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
46
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
47
TABLE 4
The researcher run a test in a system to get the result of accuracy in <1 meter by using
confusion matrix in different position, by manually calculating the data gathered from the
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
48
Table 5.
True Positive (TP): False Positive (FP):
Number of FP results: 2
Number of TP results: 4
False Negative (FN): True Negative (TN):
detected detected
Accuracy comes out to 0.62 or 62.5% ( 10 correct predictions out of 16 scenarios). Of the
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
49
Table 6
The model has a precision of 0.66 - in other words, when it detects the distance of a
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
50
In this section shows the flow of gathering data relevant on the research study.
The researchers presented a formal letter of request to the school principal of C.V. Diez
where limited face to face classes is implemented. Upon approval of the said request, the
researchers conducted an observation within the room by setting-up the computer and the
camera and with the use of the system the researcher can now gathered and analyze the
data.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
51
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
52
The classroom has a total of 16 person, 14 are students and 2 are teachers, to
observe the performance of the system and calculate the accuracy from the data gathered
Table 8.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
53
Number of FP results: 5
Number of TP results: 3
False Negative (FN): True Negative (TN):
detected detected
Confusion Matrix
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
54
Accuracy comes out to 0.62 or 62.5% ( 11 correct predictions out of 16 total person). Of
Precision = ______TP______
TP + FP
TABLE 9
True Positives (TPs): 3 False Positives (FPs): 5
The model has a precision of 37.5% - in other words,, even two person is >1m distance
Table 10
True Positives (TPs): 3 False Positives (FPs): 5
55
The model has a recall of 100% - in other words, people less than 1-meter will
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
56
CHAPTER 5
This chapter presents the, conclusion derived from the findings and the
SUMMARY
The project Social Distancing Monitoring with Alert System for Limited face to
face class for Covid-19 was developed to help the school in this upcoming face to face
class. It can apply to any specific room in a school to observe and monitor social
distancing. Specifically, this system aimed to help the student by maintaining social
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
57
FINDINGS
1. The hardware input used was able to acquire atleast all of the features for running
2. Social distance monitoring with alarm system was developed and operational;
3. The use of Python is a good environment for the system because it is user
large library
4. The overall accuracy of the system in detecting the social distance violation is
78.5%
RECOMMENDATION
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
58
The next researcher will corporate the evaluation by the user in terms of
For the future developers the system can be improved into prototype with
Level of Agreement
1.) Very satisfactory (4)
2.) Satisfactory (3)
3.) Less Satisfactory (2)
4.) Not Satisfactory (1)
FUNCTIONALITY INDACATOR 4 3 2 1
Suitability The components of the system are
appropriate for the system needs
Accurateness The system can get accurate result for
the social distancing
Security The system is a free to use anywhere to
help monitor the people
RELIABILITY INDACATOR 4 3 2 1
Maturity The system reaches its full functionality
upon the implementation and after the
series of test conducted by the
researcher.
Operability The system will automatically monitor
and alert people to be physically
distance themselves from one another.
Learnability This system is so simple to manage
making its easily to undestand.
EFFICIENCY INDACATOR 4 3 2 1
Behavior The developed framework succesfully
distinguishes individuals who walk too
near and breach/violates social distance.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
59
CONCLUSION
Based on the findings of the study, the following conclusions were derived:
1. The fps (frame rate per second) will drop and the sytem slows if the camera
3. The system cant detect people if they are in nearest distance in camera.
4. The system will automatically notify if people are not observing social distancing.
5. For better accuracy of the system, camera needs a wider range and perfect angle
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
60
REFERENCE
Bibliography
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
61
%20variable%20program..
[15] "Center For Disease Control and Prevention," 2000. [Online]. Available:
https://www.who.int/westernpacific/emergencies/covid-19/information/physical-
distancing.
[16] M. Rodriguez, I. Laptev, J. Sivic and J.-Y. Audibert, "Ieeexplore," 6-13 November
2011. [Online]. Available: https://ieeexplore.ieee.org/document/6126526.
[20] "Medium," [Online]. Available: If they cross the acceptable social distance
threshold our camera will respond by sending the detected people to the System,
where our code resides. The code will wait for the moment when the social
distance threshold has been violated and immediately sou.
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
62
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
63
APPENDICES A
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
64
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
65
APPENDICES C
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
66
APPENDICES D
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
67
# import
the
necessar
y
packages
from .social_distancing_config import NMS_THRESH
from .social_distancing_config import MIN_CONF
import numpy as np
import cv2
# construct a blob from the input frame and then perform a forward
# pass of the YOLO object detector, giving us our bounding boxes
# and associated probabilities
blob = cv2.dnn.blobFromImage(frame, 1 / 255.0, (416, 416),
swapRB=True, crop=False)
net.setInput(blob)
layerOutputs = net.forward(ln)
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
68
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
69
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
70
Distance Detection
# base
path to
YOLO
directory
MODEL_PATH = "yolo-coco"
# define the minimum safe distance (in pixels) that two people can be
# from each other
MIN_DISTANCE = 50
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
71
import numpy as np
import argparse
import imutils
import cv2
import os
ap = argparse.ArgumentParser()
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
72
args = vars(ap.parse_args())
# load the COCO class labels our YOLO model was trained on
LABELS = open(labelsPath).read().strip().split("\n")
# load our YOLO object detector trained on COCO dataset (80 classes)
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
73
if config.USE_GPU:
net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)
# determine only the *output* layer names that we need from YOLO
ln = net.getLayerNames()
vs = cv2.VideoCapture(0)
writer = None
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
74
while True:
# if the frame was not grabbed, then we have reached the end
# of the stream
if not grabbed:
break
# resize the frame and then detect people (and only people) in it
personIdx=LABELS.index("person"))
# distance
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
75
violate = set()
if len(results) >= 2:
# of pixels
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
76
violate.add(i)
violate.add(j)
if i in violate:
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
77
playsound("beep.wav")
# draw (1) a bounding box around the person and (2) the
# output frame
# screen
if args["display"] > 0:
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
78
cv2.imshow("Frame", frame)
if key == ord("q"):
break
# if an output video file path has been supplied and the video
fourcc = cv2.VideoWriter_fourcc(*"MJPG")
# if the video writer is not None, write the frame to the output
# video file
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
79
writer.write(frame)
Source Code:
https://github.com/abd-shoumik/Social-distance-detection
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
80
CURRICULUM VITAE
PERSONAL DATA
Name : Conte, Mark Jason M.
Nickname : Mak mak
Date of Birth : August 14, 1998
Place of Birth : Surigao City
Home Address : Dapa, Surigao Del Norte
Civil Status : Single
Nationality : Filipino
Religion : SDA
Email – Address : markconte23@gmail.com
Parents : Mrs. Rimelyn M. Conte
Mr. Jorge P. Conte
EDUCATIONAL BACKGROUND
Tertiary : St. Paul University Surigao
Cor. San Nicolas & Rizal Streets, Surigao City
Elementary : Don Enrique Navarro Memorial School
Dapa, Surigao Del Norte
High School : San Nicolas School
Dapa, Surigao Del Norte
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
81
CURRICULUM VITAE
PERSONAL DATA
Name : Cillo, Francis Rae R.
Nickname : Rae
Date of Birth : May 1, 1998
Place of Birth : Surigao City
Home Address : P-8 Navalca Barangay San Juan Surigao City
Civil Status : Single
Nationality : Filipino
Religion : SDA
Email – Address : cillofrancis737@gmail.com
Parents : Mrs. Raema R. Cillo
Mr. Francisco S. Cillo
EDUCATIONAL BACKGROUND
Tertiary : St. Paul University Surigao
Cor. San Nicolas & Rizal Streets, Surigao City
Elementary : C.V. Diez Memorial Central Elementary School
Surigao City
High School : Surigao Norte National High School
Surigao City
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
82
CURRICULUM VITAE
Personal Information
`
St. Paul University Surigao
St. Paul University System
Surigao City, Philippines
83