The aim of the project is to practically verify the capabilities of Yolo algorithms in detecting airplanes in photos.
YOLO (You Only Look Once) is an algorithm transformed into pre-trained models for object detection.
It is tested by the Darknet neural network framework, making it ideal for developing computer vision functions based on the COCO (Common Objects in Context) dataset.
Computer Vision is one of the most interesting applications for artificial intelligence.
Yolo treats the problem of detection as a single regression problem. It does not divide the analysis into stages. Instead, a single convolutional neural network simultaneously predicts multiple areas where the object should be located (bounding boxes) and determines the class probabilities for each of the areas where the object was detected.
The project requires a computer with a processor equipped with an AMD IPU. To run the sample programs, your computer must have the following software:
- Windows 11
- Visual Studio 2019
- Python 3
- Anaconda
- CMake
Minisforum UM790 computers are shipped with the IPU disabled. Check if the AMD IPU is present as a system device in the device manager.
If the IPU is not present in the list of devices, you should enable it in UEFI Setup.
Select:
Advanced Startup | VRecovery Options | V Restart Now
After restart:
Troubleshoot | VAdvanced options | VUEFI Firmware Settings | V Advanced | VCPU Configuration | V IPU Control | Vchange to Enabled | V Save & Exit
After restarting Windows, you may need to install drivers for the IPU, which can be downloaded from the AMD website.
In the next step, you need to install the missing software:
Visual Studio, Python, CMake and Anaconda
Don't forget to add the location of the Anaconda Script and Libararies/bin directories to your system PATH.
Before running the scripts, you need to download Ryzen AI Software and unpack it to a folder on system disk. The installation is started by the command:
\install.bat -env RyzenAI
Next, you need to activate and initialize the Anaconda environment:
conda activate RyzenAI
conda init
The project uses models developed by Ultralytics. To use them in the project, enter the following command in console:
pip install opencv-python
pip install ultralyticsplus
The Python script looks like this:
from ultralyticsplus import YOLO, render_result
# model
model = YOLO('keremberke/yolov8m-plane-detection')
# model parameters
model.overrides['conf'] = 0.25 # NMS confidence threshold
model.overrides['iou'] = 0.45 # NMS IoU threshold
model.overrides['agnostic_nms'] = False # NMS class-agnostic
model.overrides['max_det'] = 1000 # maximum number of detections per image
image = 'https://images.ctfassets.net/cnu0m8re1exe/432CoTAbQif6AAjTztTNAM/2f46d0982f97d8c8ec513cde2596a495/shutterstock_365678825.jpg'
results = model.predict(image)
print(results[0].boxes)
render = render_result(model=model, image=image, result=results[0])
render.show()
After running it, we will get an image with a marked plane with a specified probability
Object recognition in photos has many applications in various fields. In this project, the Yolo algorithm was used to detect airplanes in photos. In subsequent versions, changes will be introduced to allow for detecting the type of plane, which can be used in computer games, e.g. WarThunder for quick identification.
Such a feature will certainly be helpful for players.
Comments