Skip to content

CorEHarD5/BeSafeOnRoad

Repository files navigation

BeSafeOnRoad

  • University of La Laguna, Computer Science
  • Subject: Intelligent Systems

Index


Authors


Description

This program implements an Artificial Intelligence system capable of detecting pedestrians crossing the road when its traffic light is on red by using the YOLOv5 model, a convolutional neural network for object detection on images.


Requirements

- python3
- opencv-python
- imutils
- numpy
- pillow
- pysimplegui
- shapely

Installation

First of all, you have to clone our repository:

$ git clone https://github.com/CorEHarD5/BeSafeOnRoad.git

Then you must install all the dependencies, it can be simply done by using:

$ pip install -r requirements.txt


Program Usage

To execute this program you can run the following snippet:

  $ cd BeSafeOnRoad/
  $ python3 ./main.py

Then it will show you the main window where you can select between several options: image file, video file or camera input


Processing Image

  1. Select the folder where you have the image you want to process, it will show you a list of all image files in that folder.

select_image_folder

  1. In the showing list, choose the target image and then push the 'Start Checking' button.

select_image_file_from_list selected_image start_checking

  • Then you have to select the regions of interest. Instructions to select a ROI:

instruction

  • In the first pop up window you have to select the crosswalk ROI on the image. Once you have selected the area, press 'S' key to save it.

select_crosswalk

  • Then it will pop up a second window where you have to do the same as before, but this time selecting the predestrian traffic light.

select_traffic_light

  1. It will show you the processed image and a result text.

image_result

At this stage, you can load another image or check the same one again. While executing the program you can end it by pressing the 'Exit' button or by closing the main window.


Processing Video

  1. Select the folder where you have the video you want to process, it will show you a list of all video files in that folder.

main_menu_of_video

  1. In the showing list, choose the target video and then push the 'Load/Reload Video' button.

selected_video_folder selected_video_file

  1. Then you have to select the regions of interest by pushing the 'Select Video ROIs' button:

select_video_roi

Instructions to select a ROI:
instruction

  • In the first pop up window you have to select the crosswalk ROI on the frame. Once you have selected the area, press 'S' key to save it.

select_crosswalk_video

  • Then it will pop up a second window where you have to do the same as before, but this time selecting the predestrian traffic light.

select_traffic_light_roi_video

  1. After doing the selection, press the 'Play/Pause Video' button in order to start the video processing.

play_video result_video_1 result_video_2

  1. Finally you can choose the frame rate you want by using the slider, pause the video execution or stop it completely.

At this stage, you have several options you can choose:

  • Load another video
  • Reload the current video
  • Select others ROIs

While executing the program you can end it by pressing the 'Exit' button or by closing the main window.


Processing Camera

  1. In the showing list, choose the target camera and then push the 'Load/Reload Camera' button.

main_camera_menu load_camera

  1. Then you have to select the regions of interest by pushing the 'Select Camera ROIs' button:

select_roi_camera

Instructions to select a ROI:
instruction

  • In the first pop up window you have to select the crosswalk ROI on the frame. Once you have selected the area, press 'S' key to save it.

select_crosswalk_camera

  • Then it will pop up a second window where you have to do the same as before, but this time selecting the predestrian traffic light.

select_traffic_light_camera

  1. After doing the selection, press the 'Play/Pause Camera' button in order to start the camera processing.

play_camera result_camera

  1. Finally you can choose the frame rate you want by using the slider, pause the camera execution or stop it completely.

At this stage, you have several options you can choose:

  • Load another camera
  • Reload the current camera
  • Select others ROIs

While executing the program you can end it by pressing the 'Exit' button or by closing the main window.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages