How to install and set-up YoloV8 engine in python for object for object detection ?
We wanna to detect object. so yolo provide their own models and we cam make also our model. here we use yolo’s default model and default objects.
so, in yolo default model can predict real life object like pen,mouse,chair,person,glass etc. so first we train and test existing model and data set
We are open for making our own object detection
example: if i wanna detect the only white big cat , then we first prepare images with label annotation( for make annotation we use free software like cvat or makesense or label studio). and then we train model and then after test the model with new data.
But here we not prepare annotation images and not make our model. we use existing model of YoLo which can predict common object like mouse, chair , person etc
before start make sure you have installed python and pip
check python installed with
python — version
git clone https://github.com/ultralytics/ultralytics.git
cd ultralytics
pip install -e .
Now let’s train in build model
feel free to change command arguments
yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01
Now let’s predict the model with existing COCO dataset (this is in build image dataset )
# if you wanna predict the youtube video data
yolo predict model=yolov8n-seg.pt source='https://youtu.be/Zgi9g1ksQHc' imgsz=320
or
# if you wanna predict the live webcam data
yolo predict model=yolov8n-seg.pt source=0 imgsz=320
or
# if you wanna predict the given data (add png or mp4 files in predict_this folder)
yolo predict model=yolov8n-seg.pt source=./predict_this imgsz=320