1. Introduction to Yolo v8

Continuing from the previous article, Yolo v8 offers two modes of operation: you can write and execute a Python file yourself, or use the Command Line Interface (CLI). Here, we will unify the process by operating through the Terminal.

Open the terminal:

yolo predict model=yolov8n.pt source='<https://ultralytics.com/images/bus.jpg>'

https://yushaing.vercel.app/assets/images/1-ff469fce845b4df8878773a59aa8361a.png

2. Setting Up for Prediction

Here, it will download an image file named 'bus.jpg' from the official website to your computer. Then, it will use the yolov8n model to predict (predict) the contents of this image. The results of the prediction will be stored in the 'runs/detect/predict' directory (by default, this will be in your user-level folder).

https://yushaing.vercel.app/assets/images/2-d34ebb0e16d510a4fed930f0a6680cac.png

Original Image:

https://yushaing.vercel.app/assets/images/3-aae57470060c918546828904f3d52ba7.png

The results predicted by Yolov8n:

https://yushaing.vercel.app/assets/images/4-c0d45865490e260ecb7531343c27a2ae.png

Below are the types of models trained using Yolo, totaling 5 varieties:

https://yushaing.vercel.app/assets/images/5-8e7ae2a5ef60a25b8852a5abd2c2081b.png

For lighter training, you can choose YOLOv8n as the training model. This concludes the basic image prediction with Yolo.

3. Training the Yolo Model

Next, we will proceed with image model training, which is the well-known machine learning (Machine Learning). We aim to train our model to increase the accuracy of object detection to meet our expectations.

The official training file is 'coco.yaml'. Click here to view the official document file. Here, we use their trained yaml file as an example for our training.