Views
No views yet
pip install -U yolov51import yolov5
2model = yolov5.load('MBARI-org/megamidwater')
3
4# Run the yolo
5# set model parameters
6model.conf = 0.25 # NMS confidence threshold
7model.iou = 0.1 # NMS IoU threshold
8model.agnostic = False # NMS class-agnostic
9model.multi_label = False # NMS multiple labels per box
10model.max_det = 1000 # maximum number of detections per image
11
12# set image
13img = 'http://dsg.mbari.org/images/dsg/external/Ctenophora/Deiopea_01.png'
14
15# perform inference
16results = model(img, size=1280)
17
18# print results
19print(results.pandas().xyxy[0])yolov5 train --data data.yaml --img 1280 --batch 16 --weights mbari-org/megamidwater --epochs 10