Made this model using Yolov5, PyTorch and OpenCV to detect whether a driver is sleeping or not.
- Installing Ultralytics YOLO (Extention of YoloV4)
- Making Detections (Awake or Sleeping/Drowsy)
- Training our Model
- Real Time performance
- Installing YOLO V5.
- Label Images using LabelImg with exports to YOLO Formats.
- Real Time image rendering from scratch.
-
PyTorch : PyTorch is a machine learning framework based on the Torch library, used for applications such as computer vision and natural language processing, originally developed by Meta AI and now part of the Linux Foundation umbrella. It is free and open-source software released under the Modified BSD license.
-
Yolov5 : YOLOv5 🚀 is a family of compound-scaled object detection models trained on the COCO dataset, and includes simple functionality for Test Time Augmentation (TTA), model ensembling, hyperparameter evolution, and export to ONNX, CoreML and TFLite
(Import them listed below: )
3. Torch (used to load YOLO model and make detection)
4. matplotlib (for visualizing images)
5. numpy (strong array transformation)
6. Cv2 (webcam access)
=> Model can load using "torch.hub.load('ultralytics/yolov5', 'yolo5s')
=> Here s represent Small, (alternative => s, m, l, x)
- Create A dataset
- Label it using LabelImg
- Train the model
- Render and display