This project demonstrates object detection using the YOLO algorithm with OpenCV in Python. The provided code loads a pre-trained YOLO model and performs object detection on a given image, displaying the detected objects with bounding boxes.
- Python 3.9
- OpenCV
- NumPy
bash Copy code git clone https://github.com/AlirezaHabibi1377/YOLO-Object-Detection cd yolo-object-detection
bash
Copy code
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
bash Copy code pip install opencv-python numpy
Download the YOLO model configuration, weights, and class names files. Ensure the following files are available in the specified paths:
yolov3.cfg (YOLO configuration file) yolov3.weights (YOLO pre-trained weights) coco.names (COCO class labels) Update the paths in the script to point to these files.
Set the path to the image you want to use for object detection. Update the img_path variable in the script:
python
img_path = r"E:\Perception working\Opencv\yolo_object_detection\sample5.jpg" # Change this to your image pathExecute the Python script:
python yolo_object_detection.pyMy email: mo.alireza77habibi@gmail.com



