Author | HoshinoKun |
---|---|
hoshinokun@346pro.club |
A gadget that uses a stereo camera for target recognition and ranging, both working in sync and marked on the image.
The combined work based on the two projects of hoshinohikari/keras-yolo3-py2 and hoshinohikari/Double-target
Nanchang Aviation University Graduation design work in 2019.
Please read the contents of Some issues to know before using.
At present, stereo ranging uses SGBM in OpenCV, and object detection uses keras-yolo3.(completed)- In the future, stereo matching may be replaced with PSMNet.
- Adjust convert to make it compatible with Python 3.7
- The distance measurement section is currently complete.
- Buy or make a stereo camera,and test out its map, you can refer to my github(hoshinohikari/Double-target)
- Install the conda like minoconda or anaconda,and install
Keras
Tensorflow
OpenCV
Opencv-contrib-python
- Download YOLOv3 weights from YOLO website.
- Convert the Darknet YOLO model to a Keras model.
- Run YOLO detection.
wget https://pjreddie.com/media/files/yolov3.weights
python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5
For Tiny YOLOv3, just do in a similar way, just specify model path and anchor path with --model model_file
and --anchors anchor_file
.
usage: run.py [-h] [--camera [CAMERA]] [--width [WIDTH]] [--height [HEIGHT]]
[--output [OUTPUT]]
optional arguments:
-h, --help show this help message and exit
--camera [CAMERA] Camera mode, will ignore all positional arguments, please
input your camera number
--width [WIDTH] [Optional] Camera width
--height [HEIGHT] [Optional] Camera height
--output [OUTPUT] [Optional] Video output path
You can also use GUI.py, which depends on pyqt5
python GUI.py
-
The test environment is
- Python 2.7.15(Miniconda)
- Keras 2.1.6
- tensorflow 1.12.0
- OpenCV 3.4.4
or - Python 3.6.8(Miniconda)
- Keras 2.1.6
- tensorflow 1.12.0
- OpenCV 3.4.4
-
Theoretically supports multi-GPU, but I can't test it, so I didn't add this option.
-
convert.py Can't used in Python 3.7