Skip to content

Instantly share code, notes, and snippets.

View benjaminlq's full-sized avatar

Le Quan benjaminlq

  • Singapore Management University
  • Singapore
View GitHub Profile
from ultralytics import YOLO
model = YOLO("./runs/detect/train/weights/best.pt")
# It'll use the data yaml file in model.pt if you don't set data.
model.val(conf=0.5)
# or you can set the data you want to val
model.val(data="./datasets/boat.yaml", conf=0.5)
!yolo task=detect mode=val model=./runs/detect/train/weights/best.pt data=./datasets/boat.yaml conf=0.5
from ultralytics import YOLO
# Load a model
model = YOLO("yolov8n.pt") # load a pretrained model
# Train the model
results = model.train(data="./datasets/boat.yaml", imgsz=800, batch=8, epochs=50, plots=True)
!yolo task=detect mode=train model=yolov8s.pt data=./datasets/boat.yaml imgsz=800 batch=8 epochs=50 plots=True
!git clone https://github.com/ultralytics/ultralytics
!pip install -e ultralytics
### Install YOLOv8 ###
!pip install ultralytics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.