This is a YOLO C++ API project which provides a graphical user interface (GUI) for users to customize settings and perform real-time object detection using their webcam. This project has been developed and tested on a Jetson Nano device.
The following dependencies are required to build and run this project. Make sure to install the correct versions as specified below:
- OpenCV (4.x.x)
- Qt (5.15.9)
- Create a
models
folder in the root directory. - In the models folder, create 3 folders:
cfg
,names
, andweights
. - Add models you want to use in these 3 folders. For example, if you wanted to use yolov7-tiny, you would need to add
yolov7-tiny.weights
in the weights folder,yolov7-tiny.cfg
in the cfg, andcoco.names
in the names folder.
-
Clone the repository and navigate to the project directory:
git clone https://github.com/ethanlaj/yolo-cpp-api.git cd yolo-cpp-api
-
Compile the project:
make
-
Run the compiled binary:
./yolo_detect
-
The GUI will open, allowing you to choose a specific model to use. This project only supports .weights formatted models.
-
Click the "Start" button to begin real-time object detection using your webcam. Detected objects will be displayed with bounding boxes and labels.
- Ability to use different models
- While running, can customize object detection settings such as confidence and NMS thresholds.
- Start and stop real-time object detection.
- Display detected objects with bounding boxes and labels.
If frames cannot be captured by the camera, try restarting the nvargus-daemon
by running the following command:
sudo systemctl restart nvargus-daemon