Make YOLO a module (#111)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
0303ced8ab
commit
34829a6b29
4 changed files with 82 additions and 39 deletions
18
README.md
18
README.md
|
|
@ -16,19 +16,21 @@ pip install -e .
|
|||
### 1. CLI
|
||||
To simply use the latest Ultralytics YOLO models
|
||||
```bash
|
||||
yolo task=detect mode=train model=s.yaml ...
|
||||
classify infer s-cls.yaml
|
||||
segment val s-seg.yaml
|
||||
yolo task=detect mode=train model=yolov8n.yaml ...
|
||||
classify predict yolov8n-cls.yaml
|
||||
segment val yolov8n-seg.yaml
|
||||
```
|
||||
### 2. Python SDK
|
||||
To use pythonic interface of Ultralytics YOLO model
|
||||
```python
|
||||
import ultralytics
|
||||
from ultralytics import YOLO
|
||||
|
||||
model = YOLO()
|
||||
model.new("s-seg.yaml") # automatically detects task type
|
||||
model.load("s-seg.pt") # load checkpoint
|
||||
model.train(data="coco128-segments", epochs=1, lr0=0.01, ...)
|
||||
model = YOLO.new('yolov8n.yaml') # create a new model from scratch
|
||||
model = YOLO.load('yolov8n.pt') # load a pretrained model (recommended for best training results)
|
||||
|
||||
results = model.train(data='coco128.yaml', epochs=100, imgsz=640, ...)
|
||||
results = model.val()
|
||||
results = model.predict(source='bus.jpg')
|
||||
success = model.export(format='onnx')
|
||||
```
|
||||
If you're looking to modify YOLO for R&D or to build on top of it, refer to [Using Trainer]() Guide on our docs.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue