Drivers obtain road traffic information from various locations while driving, resulting in distracted driving and eventually traffic accidents. Thus, the position and duration of the driver’s gaze while driving must be studied. This study primarily aims to detect the driver’s gaze dispersion using eye-tracking technology and YOLOv5 algorithm. The eye-tracking technology uses the traditional method of extracting the area of interest (AOI) to analyze the changes in driver’s pupil diameter and gaze position and duration in each area during driving. The improved YOLOv5 algorithm is optimized to accurately detects vehicles and targets from the video. Then, the information extracted from the target detection frame is combined with the eye-point data recorded by the eye tracker. The distance from the gaze point to each target detection frame is calculated to accurately determine the driver’s gaze location and analyze whether the driver is distracted.