Add FAQs to Docs Datasets and Help sections (#14211)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
64862f1b69
commit
d5db9c916f
73 changed files with 3296 additions and 110 deletions
|
|
@ -101,6 +101,7 @@ Validate trained YOLOv8n-cls model accuracy on the MNIST160 dataset. No argument
|
|||
metrics.top1 # top1 accuracy
|
||||
metrics.top5 # top5 accuracy
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -126,6 +127,7 @@ Use a trained YOLOv8n-cls model to run predictions on images.
|
|||
# Predict with the model
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -153,6 +155,7 @@ Export a YOLOv8n-cls model to a different format like ONNX, CoreML, etc.
|
|||
# Export the model
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ Train YOLOv8n on the COCO8 dataset for 100 epochs at image size 640. For a full
|
|||
# Train the model
|
||||
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -102,6 +103,7 @@ Validate trained YOLOv8n model accuracy on the COCO8 dataset. No argument need t
|
|||
metrics.box.map75 # map75
|
||||
metrics.box.maps # a list contains map50-95 of each category
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -127,6 +129,7 @@ Use a trained YOLOv8n model to run predictions on images.
|
|||
# Predict with the model
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -154,6 +157,7 @@ Export a YOLOv8n model to a different format like ONNX, CoreML, etc.
|
|||
# Export the model
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ Train YOLOv8n-obb on the `dota8.yaml` dataset for 100 epochs at image size 640.
|
|||
# Train the model
|
||||
results = model.train(data="dota8.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -123,6 +124,7 @@ retains its training `data` and arguments as model attributes.
|
|||
metrics.box.map75 # map75(B)
|
||||
metrics.box.maps # a list contains map50-95(B) of each category
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -148,6 +150,7 @@ Use a trained YOLOv8n-obb model to run predictions on images.
|
|||
# Predict with the model
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -175,6 +178,7 @@ Export a YOLOv8n-obb model to a different format like ONNX, CoreML, etc.
|
|||
# Export the model
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ retains its training `data` and arguments as model attributes.
|
|||
metrics.box.map75 # map75
|
||||
metrics.box.maps # a list contains map50-95 of each category
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -142,6 +143,7 @@ Use a trained YOLOv8n-pose model to run predictions on images.
|
|||
# Predict with the model
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -169,6 +171,7 @@ Export a YOLOv8n Pose model to a different format like ONNX, CoreML, etc.
|
|||
# Export the model
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ Train YOLOv8n-seg on the COCO128-seg dataset for 100 epochs at image size 640. F
|
|||
# Train the model
|
||||
results = model.train(data="coco8-seg.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -107,6 +108,7 @@ retains its training `data` and arguments as model attributes.
|
|||
metrics.seg.map75 # map75(M)
|
||||
metrics.seg.maps # a list contains map50-95(M) of each category
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -132,6 +134,7 @@ Use a trained YOLOv8n-seg model to run predictions on images.
|
|||
# Predict with the model
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -159,6 +162,7 @@ Export a YOLOv8n-seg model to a different format like ONNX, CoreML, etc.
|
|||
# Export the model
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
|
|
@ -196,21 +200,21 @@ To train a YOLOv8 segmentation model on a custom dataset, you first need to prep
|
|||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained YOLOv8 segment model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
# Load a pretrained YOLOv8 segment model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
|
||||
# Train the model
|
||||
results = model.train(data="path/to/your_dataset.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
# Train the model
|
||||
results = model.train(data="path/to/your_dataset.yaml", epochs=100, imgsz=640)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment train data=path/to/your_dataset.yaml model=yolov8n-seg.pt epochs=100 imgsz=640
|
||||
```
|
||||
```bash
|
||||
yolo segment train data=path/to/your_dataset.yaml model=yolov8n-seg.pt epochs=100 imgsz=640
|
||||
```
|
||||
|
||||
Check the [Configuration](../usage/cfg.md) page for more available arguments.
|
||||
|
||||
|
|
@ -230,23 +234,23 @@ Loading and validating a pretrained YOLOv8 segmentation model is straightforward
|
|||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
|
||||
# Validate the model
|
||||
metrics = model.val()
|
||||
print("Mean Average Precision for boxes:", metrics.box.map)
|
||||
print("Mean Average Precision for masks:", metrics.seg.map)
|
||||
```
|
||||
# Validate the model
|
||||
metrics = model.val()
|
||||
print("Mean Average Precision for boxes:", metrics.box.map)
|
||||
print("Mean Average Precision for masks:", metrics.seg.map)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment val model=yolov8n-seg.pt
|
||||
```
|
||||
```bash
|
||||
yolo segment val model=yolov8n-seg.pt
|
||||
```
|
||||
|
||||
These steps will provide you with validation metrics like Mean Average Precision (mAP), crucial for assessing model performance.
|
||||
|
||||
|
|
@ -258,20 +262,20 @@ Exporting a YOLOv8 segmentation model to ONNX format is simple and can be done u
|
|||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
|
||||
# Export the model to ONNX format
|
||||
model.export(format="onnx")
|
||||
```
|
||||
# Export the model to ONNX format
|
||||
model.export(format="onnx")
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo export model=yolov8n-seg.pt format=onnx
|
||||
```
|
||||
```bash
|
||||
yolo export model=yolov8n-seg.pt format=onnx
|
||||
```
|
||||
|
||||
For more details on exporting to various formats, refer to the [Export](../modes/export.md) page.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue