This is a Python Script which uses YoloV3 to detect objects in images. YOLOv3 (You Only Look Once, Version 3) is a real-time object detection algorithm that identifies specific objects in videos, live feeds, or images. YOLO uses features learned by a deep convolutional neural network to detect an object. Versions 1-3 of YOLO were created by Joseph Redmon and Ali Farhadi (Reference - viso.ai).
Install the following Python libraries in your Virtual Environment using PIP.
Note: The library names are CASE-SENSITIVE for PIP installations below. Make sure your type them correctly.
Install OpenCV for Python
pip install opencv-python
Install Numpy for Python
pip install numpy
Download the YoloV3-320 weights from the link below.
https://pjreddie.com/media/files/yolov3.weights
To check out other models, click on the link below.
https://pjreddie.com/darknet/yolo/
Download a copy of this repository onto your local machine and extract it into a suitable folder.
- Create a Virtual Environment in that folder.
- Install all the required Python libraries mentioned above.
- (Important) Move the downloaded YoloV3 Weights into the YoloFiles folder in the Root Directory. The script will not work without this step.
- Open a Command Prompt/Terminal in the Root Directory of the Project.
- To test an image, run the following script-
python YoloImageObjectDetection.py
- To test a video, run the following script-
python YoloVideoObjectDetection.py
- There are already some images and videos provided in the Assets folder for testing. To test a different image/video for object detection, place the desired image/video in the Assets folder in the Root Directory and change the file name on the 9th line of the YoloImageObjectDetection.py script in the case of an image and YoloVideoObjectDetection.py in the case of a video.
- Enjoying playing around with the scripts!