- Obj_Det.py: The main Python script that performs object detection and displays the results.
- yolov3.cfg: The configuration file for the YOLOv3 neural network model.
- coco.names: The list of 80 object classes that the YOLOv3 model can detect.
Note: The yolov3.weights file, which contains the pre-trained weights for the YOLOv3 model, is not included in this repository. You will need to download this file separately from the official YOLO website or other reliable sources and place it in the same directory as the other project files.
Install the required dependencies: 1. Python 3.x 2. OpenCV 3. Numpy 4. robomaster (optional, for integration with the Robomaster robot) 5. Download the yolov3.weights file from a reliable source and place it in the same directory as the other project files. 6. Run the Obj_Det.py script to start the object detection process. The Obj_Det.py script performs the following steps:- Load the pre-trained YOLOv3 model by reading the yolov3.weights and yolov3.cfg files.
- Load the list of object classes from the coco.names file.
- Initialize the Robomaster robot and its camera.
- Define a detect_objects function that takes an input image and performs object detection using the YOLOv3 model.
- The function creates a blob from the input image and passes it through the YOLOv3 network.
- It then processes the output of the network to extract the bounding boxes, confidence scores, and class IDs of the detected objects.
- The function applies non-maximum suppression to remove overlapping bounding boxes and returns the list of detected objects.
- In the main loop, the script continuously reads frames from the Robomaster camera, detects objects in each frame, and displays the results with bounding boxes and class labels.
- The program continues running until the user presses the 'q' key to exit.
- Connect a camera or video source to your system.
- Run the Obj_Det.py script.
- The script will start detecting objects in the live video stream and display the results with bounding boxes and class labels.
- To stop the program, press the 'q' key.