|
|
@ -86,12 +86,15 @@ YOLOv8 may also be used directly in a Python environment, and accepts the same [
|
|
|
|
```python
|
|
|
|
```python
|
|
|
|
from ultralytics import YOLO
|
|
|
|
from ultralytics import YOLO
|
|
|
|
|
|
|
|
|
|
|
|
model = YOLO("yolov8n.pt") # load a pretrained YOLOv8n model
|
|
|
|
# Load a model
|
|
|
|
|
|
|
|
model = YOLO("yolov8n.yaml") # build a new model from scratch
|
|
|
|
model.train(data="coco128.yaml") # train the model
|
|
|
|
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
|
|
|
|
model.val() # evaluate model performance on the validation set
|
|
|
|
|
|
|
|
model.predict(source="https://ultralytics.com/images/bus.jpg") # predict on an image
|
|
|
|
# Use the model
|
|
|
|
model.export(format="onnx") # export the model to ONNX format
|
|
|
|
results = model.train(data="coco128.yaml", epochs=3) # train the model
|
|
|
|
|
|
|
|
results = model.val() # evaluate model performance on the validation set
|
|
|
|
|
|
|
|
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
|
|
|
|
|
|
|
success = YOLO("yolov8n.pt").export(format="onnx") # export a model to ONNX format
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
[Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/yolo/v8/models) download automatically from the latest
|
|
|
|
[Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/yolo/v8/models) download automatically from the latest
|
|
|
@ -204,7 +207,7 @@ We love your input! YOLOv5 and YOLOv8 would not be possible without help from ou
|
|
|
|
|
|
|
|
|
|
|
|
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
|
|
|
|
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/ultralytics/yolov5/graphs/contributors"><img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/image-contributors-1280.png"/></a>
|
|
|
|
<a href="https://github.com/ultralytics/ultralytics/graphs/contributors"><img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/image-contributors-1280.png"/></a>
|
|
|
|
|
|
|
|
|
|
|
|
## <div align="center">License</div>
|
|
|
|
## <div align="center">License</div>
|
|
|
|
|
|
|
|
|
|
|
|