Reformat Markdown code blocks (#12795)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
2af71d15a6
commit
fceea033ad
128 changed files with 1067 additions and 1018 deletions
|
|
@ -69,12 +69,12 @@ Train a YOLOv8-pose model on the COCO128-pose dataset.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO('yolov8n-pose.yaml') # build a new model from YAML
|
||||
model = YOLO('yolov8n-pose.pt') # load a pretrained model (recommended for training)
|
||||
model = YOLO('yolov8n-pose.yaml').load('yolov8n-pose.pt') # build from YAML and transfer weights
|
||||
model = YOLO("yolov8n-pose.yaml") # build a new model from YAML
|
||||
model = YOLO("yolov8n-pose.pt") # load a pretrained model (recommended for training)
|
||||
model = YOLO("yolov8n-pose.yaml").load("yolov8n-pose.pt") # build from YAML and transfer weights
|
||||
|
||||
# Train the model
|
||||
results = model.train(data='coco8-pose.yaml', epochs=100, imgsz=640)
|
||||
results = model.train(data="coco8-pose.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
|
@ -107,15 +107,15 @@ retains its training `data` and arguments as model attributes.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO('yolov8n-pose.pt') # load an official model
|
||||
model = YOLO('path/to/best.pt') # load a custom model
|
||||
model = YOLO("yolov8n-pose.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom model
|
||||
|
||||
# Validate the model
|
||||
metrics = model.val() # no arguments needed, dataset and settings remembered
|
||||
metrics.box.map # map50-95
|
||||
metrics.box.map # map50-95
|
||||
metrics.box.map50 # map50
|
||||
metrics.box.map75 # map75
|
||||
metrics.box.maps # a list contains map50-95 of each category
|
||||
metrics.box.maps # a list contains map50-95 of each category
|
||||
```
|
||||
=== "CLI"
|
||||
|
||||
|
|
@ -136,11 +136,11 @@ Use a trained YOLOv8n-pose model to run predictions on images.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO('yolov8n-pose.pt') # load an official model
|
||||
model = YOLO('path/to/best.pt') # load a custom model
|
||||
model = YOLO("yolov8n-pose.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom model
|
||||
|
||||
# Predict with the model
|
||||
results = model('https://ultralytics.com/images/bus.jpg') # predict on an image
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
=== "CLI"
|
||||
|
||||
|
|
@ -163,11 +163,11 @@ Export a YOLOv8n Pose model to a different format like ONNX, CoreML, etc.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO('yolov8n-pose.pt') # load an official model
|
||||
model = YOLO('path/to/best.pt') # load a custom trained model
|
||||
model = YOLO("yolov8n-pose.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom trained model
|
||||
|
||||
# Export the model
|
||||
model.export(format='onnx')
|
||||
model.export(format="onnx")
|
||||
```
|
||||
=== "CLI"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue