How to use
pip install -U yolov5
- Load model and perform prediction:
import yolov5
model = yolov5.load('fcakyon/yolov5s-v7.0')
model.conf = 0.25
model.iou = 0.45
model.agnostic = False
model.multi_label = False
model.max_det = 1000
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
results = model(img)
results = model(img, size=640)
results = model(img, augment=True)
predictions = results.pred[0]
boxes = predictions[:, :4]
scores = predictions[:, 4]
categories = predictions[:, 5]
results.show()
results.save(save_dir='results/')
- Finetune the model on your custom dataset:
yolov5 train --img 640 --batch 16 --weights fcakyon/yolov5s-v7.0 --epochs 10 --device cuda:0