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:
Glenn Jocher 2024-05-18 18:58:06 +02:00 committed by GitHub
parent 2af71d15a6
commit fceea033ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
128 changed files with 1067 additions and 1018 deletions

View file

@ -75,21 +75,21 @@ To train DOTA dataset, we split original DOTA images with high-resolution into i
=== "Python"
```python
from ultralytics.data.split_dota import split_trainval, split_test
from ultralytics.data.split_dota import split_test, split_trainval
# split train and val set, with labels.
split_trainval(
data_root='path/to/DOTAv1.0/',
save_dir='path/to/DOTAv1.0-split/',
rates=[0.5, 1.0, 1.5], # multiscale
gap=500
data_root="path/to/DOTAv1.0/",
save_dir="path/to/DOTAv1.0-split/",
rates=[0.5, 1.0, 1.5], # multiscale
gap=500,
)
# split test set, without labels.
split_test(
data_root='path/to/DOTAv1.0/',
save_dir='path/to/DOTAv1.0-split/',
rates=[0.5, 1.0, 1.5], # multiscale
gap=500
data_root="path/to/DOTAv1.0/",
save_dir="path/to/DOTAv1.0-split/",
rates=[0.5, 1.0, 1.5], # multiscale
gap=500,
)
```
@ -109,10 +109,10 @@ To train a model on the DOTA v1 dataset, you can utilize the following code snip
from ultralytics import YOLO
# Create a new YOLOv8n-OBB model from scratch
model = YOLO('yolov8n-obb.yaml')
model = YOLO("yolov8n-obb.yaml")
# Train the model on the DOTAv2 dataset
results = model.train(data='DOTAv1.yaml', epochs=100, imgsz=640)
results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=640)
```
=== "CLI"

View file

@ -34,10 +34,10 @@ To train a YOLOv8n-obb model on the DOTA8 dataset for 100 epochs with an image s
from ultralytics import YOLO
# Load a model
model = YOLO('yolov8n-obb.pt') # load a pretrained model (recommended for training)
model = YOLO("yolov8n-obb.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data='dota8.yaml', epochs=100, imgsz=640)
results = model.train(data="dota8.yaml", epochs=100, imgsz=640)
```
=== "CLI"

View file

@ -40,10 +40,10 @@ To train a model using these OBB formats:
from ultralytics import YOLO
# Create a new YOLOv8n-OBB model from scratch
model = YOLO('yolov8n-obb.yaml')
model = YOLO("yolov8n-obb.yaml")
# Train the model on the DOTAv2 dataset
results = model.train(data='DOTAv1.yaml', epochs=100, imgsz=640)
results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=640)
```
=== "CLI"
@ -78,7 +78,7 @@ Transitioning labels from the DOTA dataset format to the YOLO OBB format can be
```python
from ultralytics.data.converter import convert_dota_to_yolo_obb
convert_dota_to_yolo_obb('path/to/DOTA')
convert_dota_to_yolo_obb("path/to/DOTA")
```
This conversion mechanism is instrumental for datasets in the DOTA format, ensuring alignment with the Ultralytics YOLO OBB format.