Skip to content

Latest commit

History

History
71 lines (55 loc) · 3.62 KB

File metadata and controls

71 lines (55 loc) · 3.62 KB

Copilot : Driving assistance on mobile devices

Lane and obstacle detection for active assistance during driving.


VehiclePosition+collisiontimesuperposedinthetopview

Accompanying article https://towardsdatascience.com/copilot-driving-assistance-635e1a50f14

Global annual road accidents fatalities total about 1.5 million which is just about the population of Mauritius. 90% of these occur in low and middle income countries which have less than half of the total vehicles in the world. Advanced driver-assistance systems (ADAS) Lane detection, collision warning are present in less than 0.1% of the vehicles. They are almost non existent in developing countries. Median Smartphone ownership in emerging economies is about 10 times as high as that of four wheeler. While we already have semi autonomous vehicles running about in parts of the world. This repository checks how close we might come to using a mobile computing platform as an ADAS copilot.

DOWNLOAD WEIGHTS AND CODE

! gitclonehttps://github.com/visualbuffer/copilot.git
! mvcopilot/* ./
! wget-P ./model_data/https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/backend.h5


Robustnessfordifferentilluminationconditionsz

USAGE EXAMPLE

fromframeimportFRAMEfile_path="videos/highway.mp4"# <== Upload appropriate file video_out="videos/output11.mov"frame=FRAME( ego_vehicle_offset=.15, # SELF VEHICLE OFFSETyellow_lower=np.uint8([ 20, 50, 100]), # LOWER YELLOW HLS THRESHOLDyellow_upper=np.uint8([35, 255, 255]), # UPER YELLOW HLS THRESHOLDwhite_lower=np.uint8([ 0, 200, 0]), # LOWER WHITE THRESHOLDwhite_upper=np.uint8([180, 255, 100]), # UPPER WHITE THRESHOLDlum_factor=118, # NORMALIZING LUM FACTORmax_gap_th=0.45, # MAX GAP THRESHOLDYOLO_PERIOD=.25, # YOLO PERIODlane_start=[0.35,0.75] , # LANE INITIATIONverbose=3) # VERBOSITYframe.process_video(file_path, 1,\
video_out=video_out,pers_frame_time=144,\
t0=144 , t1=150)#None)
PARAMETERDescription
SELF VEHICLE OFFSETTrim off from bottom edge video if ego vehicle covers part of the frame % of front view
LOWER YELLOW HLS THRESHOLDLower yellow HLS threshold used to prepare the mask. Tune down if yellow lane is not detected, up if all the foilage is
UPPER YELLOW HLS THRESHOLDUpper threshold for identifying yellow lanes
LOWER WHITE THRESHOLDLower yellow HLS threshold used to prepare the mask. Tune up saturation if foilage lights up the entire scene
UPPER WHITE THRESHOLD
NORMALIZING LUM FACTORFactor used to normalize luminosity against, reducing increses lower Lum threshold
MAX GAP THRESHOLDMax continous gap tollerated in the lane detection % of top-view height
YOLO PERIODPeriod [s] after which YOLO is detected, typ 2s reducing decreases processing fps increases detection
LANE INITIATIONintial guess for lane start % of top-view width
VERBOSITY1 Show lesser,2 Show less,3 Show everything


Detectinglanechangeautomatically

Notebooks

DIRECTORYCOLAB
./notebooks/coPilot.ipynbhttps://colab.research.google.com/drive/1CdqDXZqssDgSC35W4A-4Gp8kfqzyPKug

Ref:

https://github.com/qqwweee/keras-yolo3