Professional Documents
Culture Documents
10th sem final project
10th sem final project
B AUTONOMOUS COLLEGE
DEPARTMENT OF IMSc.ETC
Submitted by :-
Gopinath Parida(201853031)
Dibyasmita Sahoo (201853011)
Monalisa Beura(201853033)
CONTENTS
1. Objective
2. Introduction
3. Hardware Software Requirement
4. Block Diagram
5. Working Model
6. Coding And Analysis
7. Advantages And Disadvantages
8. Future Scope
9. Conclusion
10. Reference
OBJECTIVE
Intelligent monitoring has emerged as the most crucial application in
recent years. Object detection is considered as a hotspot of computer
vision. As the bike riders in our country are increasing and the road
misshapes are also increasing day by day, due to which many
accidents occur which led to death and most of them are caused due
to not wearing helmets. So, our model detects the helmet of the rider.
If the two-wheeler rider does not wear the helmet, it detects the
number plate of the vehicle.
INTRODUCTION
Our world is developing on a very fast scale and it’s one of the reasons
that the Automobile industry in which motorcycle has always been the
predominant mode of transport. Since the rises of two wheelers have
increased so it led to accidents and injuries. Many riders generally do
not use helmets and that is one of the major reasons. So our main
motive behind helmet and number plate recognization and detection
was to first detect first if someone is wearing helmet or not, if he is
wearing it, n problem,but if not, it detect his number plate.
HARDWARE COMPONET
HDMI cod
5v Power
supply
Lcd display
SOFTWARE SPECIFICATIONS
Anaconda
Python
Google colab
BLOCK DIAGRAM
WORKING MODEL
5v power supply
CODING
import cv2
import numpy as np
import os
import imutils
from tensorflow.keras.models import load_model
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
if cv2.waitKey(1) == 27:
break
writer.release()
cap.release()
cv2.waitKey(0)
Code explanation
Line 1–8 — Importing required libraries.
Line 10 — Allow TensorFlow to use GPU.
Line 12 — Read the network weights from yolo files. These ‘yolo.weights’ is the file which we trained just to detect bikes and number
plates.
Line 13–14 — If you want to use GPU, set the backend and target to CUDA.
Line 17–18 — Load the CNN model we trained to detect helmets.
Line 20 — VideoCapture object to read frames from the video feed.
Line 21 — A color array which we will use later.
Line 23–27 — This writer will help write our output frames to a video file using cv2.VideoWriter().
Line 29–37 — This function will be provided with an image and the model will predict whether there is a helmet or not in the image.
Line 39–40 — Get the output layers to take the output from them in further steps.
Line 46–49 — Read the frames from the video file, resize them and get their height and width.
Line 51 — Use cv2.dnn.blobFromImage() to create a blob from the image and to use this blob as input to our network.
Line 53 — Set this blob as input to our network.
Line 54 — Flow this blob through the network and get the outputs.
Line 60–76 — Get the outputs from the network.
Line 78 — Get the indexes of the boxes which we will not consider due to Non-Maximum Suppression.
Line 80–99 — Draw a green box around bikes and a red box around number plates. Detect if there is a helmet or not and print that.
Line 102–103 — Write the output images as a video.
Line 105–106 — Break the code if someone hits the ESC key.
OUTPUT SNAPSHOT
ADVANTAGES
Accuracy
Speed
Automation
Scalability
Flexibility
Cost-effective
DISADVANTAGES
Data availability
Performance under different conditions
False positives and negatives
Computational complexity
Ethical considerations
FUTURE SCOPE
To directly extract the license number using an OCR (Optical Character Recognition )
CONCLUSION
In this paper, we introduce a real-time end-to-end helmet detection of motorcyclists
method based on YOLOv5 algorithm. This includes two stages of motorcycle
detection and helmet detection, and for each stage, we train a model, which are
YOLOv5-MD and YOLOv5-HD, to achieve a real-time effect while ensuring high
accuracy. In addition, our model size is still very advantageous, the first stage model
is only 20.6 MB, and the second stage model is only 14.8 MB. In our dataset, the
final end-to-end motorcycle helmet detection mAP reached 97.7%, F1-score reached
92.7, detection speed reached 63 FPS, achieved high accuracy and real-time effect.
In addition, our method can determine whether the motorcycle is overloaded by
calculating the number of helmets and No_helmets.
REFERENCE
1. Organisation mondiale de la santé: Global Status Report on Road Safety 2018, WHO (2018)
2. Ren, S., at el.: Faster R-CNN: towards real-time object detection with region proposal networks. arXiv:1506.01497 [cs],
(2016)
3. Redmon, J., et al.: You only look once: unified, real-time object detection. arXiv:1506.02640 [cs], (2016)
4. Lin, T.-Y., et al.: Focal loss for dense object detection. arXiv:1708.02002 (2018)
5. Sun, D., et al.: Visual cognition inspired vehicle re-identification via correlative sparse ranking with multi-view deep
features. In: Ren, J., et al. (Eds.): Advances in Brain Inspired Cognitive Systems Springer International Publishing, Xi’an,
China, (2018)
6. Bodla, N., et al.: Soft-NMS – Improving object detection with one line of code. arXiv:1704.04503 [cs], (2017).
7. Espinosa, J.E.: Detection of motorcycles in urban traffic using video analysis: A review. IEEE Trans. Intell. Transport. Syst.
1–16 (2020)
8. Silva, R., et al.: Automatic detection of motorcyclists without helmet. In: 2013 XXXIX Latin American Computing
Conference, Caracas, Venezuela, 7–11 Oct. 2013
9. Dahiya, K., et al.: Automatic detection of bike-riders without helmet using surveillance videos in real-time. In: 2016
International Joint Conference on Neural Networks (IJCNN)’ 2016 International Joint Conference on Neural Networks
(IJCNN), Vancouver, BC, Canada, 24–29 July 2016
10. 21. Padmini, V.L., et al.: Real time automatic detection of motorcyclists with and without a safety helmet. In: 2020
International Conference on Smart Electronics and Communication (ICOSEC), Trichy, India, 10–12 Sept. 2020