Our program that allows you to select which object detection model to use to detect objects.
We currently support the models:
- SSD with MobileNet
- Detr
- Faster R-CNN
- YOLO
The SSD model is taken from here. The YOLO model is taken from here.
- Python ≥ 3.7.10
- OpenCV2
- PyTorch ≥ 1.7.1
- Torchvision ≥ 0.8.2
To use the video function place .mp4
videos into the folder media/DrivingClips
.
Type
run.py -h
to see the help.
To use the detector with for example SSD Mobilenet on file video.mp4, type:
run.py --model ssdm --f video
To use it with the webcam just ommit the filename:
run.py --model ssdm
Running the command
run.py
without any arguments just opens the webcam and displays its output.
To record the output to a file and write information about the model like the minimum detection confidence or inference time to a log file, use the optional argument -rec
. Example:
run.py --model ssdm --f video -rec
In addition to object detection we have experimental, rule-based lane detection and distance approximation.
The distance approximation is based on the focal length of the camera. Consequently, we support this feature only on our test videos. To use it on other videos just add your camera's focal length. Then you can use distance approximation by typing -distances
:
run.py --model yolov5s -distances
To enable lane detection use the argument -lanes
:
run.py --model yolov5s -lanes