Skip to content

Algorithm based on Yolo v5 to detect the front vehicles' distance

Notifications You must be signed in to change notification settings

404nofound/Monocular_Distance_Detect

Repository files navigation

Monocular_Distance_Detect

Algorithm based on Yolo v5 to detect the front vehicles' distance

使用Yolo v5实现车辆间距离计算

Modified based on KinkangLiu

New version is launched(新版本-相对速度检测 已发布).

Monocular Distance Velocity Detect

Algorithm based on Yolo v5 and Deep Sort to detect surrounding vehicles' distance and relative velocity

How to run

# Run
python estimate_distance.py --source YOUR_PATH\data\images\demo.mp4 --view-img

The Video Demo

Output

label = label + ' ' + str('%.1f' % d[0]) + 'm ' + str(location)

d0 denotes distance.

location: -1 means the targeted vehicle in the left; 0 in the center; 1 in the right.

Important Parameters

def __init__(self):
    #自己相机的图像尺寸
    self.W = 1280
    self.H = 720
#相机高度
#关键参数,不准会导致结果不对
H = 0.4
#相机与水平线夹角, 默认为0 相机镜头正对前方,无倾斜
#关键参数,不准会导致结果不对
angle_a = 0

Tips

# CUDA 10.2
conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch

Notes

GPU NVIDIA 3060 and above: PyTorch version >= 1.11.0

About

Algorithm based on Yolo v5 to detect the front vehicles' distance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages