[Docs]: Link buttons, add autobackend, BaseModel and ops (#130)

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:
Ayush Chaurasia
2023-01-02 20:42:30 +05:30
committed by GitHub
parent af6e3c536b
commit 8996c5c6cf
10 changed files with 562 additions and 96 deletions

View File

@ -33,7 +33,7 @@ CLI requires no customization or code. You can simply run all tasks from the ter
```bash
yolo task=detect mode=train model=s.yaml device=\'0,1,2,3\'
```
[CLI Guide](#){ .md-button .md-button--primary}
[CLI Guide](cli.md){ .md-button .md-button--primary}
## Python API
Ultralytics YOLO comes with pythonic Model and Trainer interface.
@ -42,10 +42,9 @@ Ultralytics YOLO comes with pythonic Model and Trainer interface.
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 = YOLO("s-seg.yaml") # automatically detects task type
model = YOLO("s-seg.pt") # load checkpoint
model.train(data="coco128-segments", epochs=1, lr0=0.01, ...)
model.train(data="coco128-segments", epochs=1, lr0=0.01, device="0,1,2,3") # DDP mode
```
[API Guide](#){ .md-button .md-button--primary}
[API Guide](sdk.md){ .md-button .md-button--primary}

15
docs/reference/nn.md Normal file
View File

@ -0,0 +1,15 @@
# nn Module
Ultralytics nn module contains 3 main components:
1. **AutoBackend**: A module that can run inference on all popular model formats
2. **BaseModel**: `BaseModel` class defines the operations supported by tasks like Detection and Segmentation
3. **modules**: Optimized and reusable neural network blocks built on PyTorch.
## AutoBackend
:::ultralytics.nn.autobackend.AutoBackend
## BaseModel
:::ultralytics.nn.tasks.BaseModel
## Modules
TODO

162
docs/reference/ops.md Normal file
View File

@ -0,0 +1,162 @@
This module contains optimized deep learning related operations used in the Ultralytics YOLO framework
## Non-max suppression
:::ultralytics.ops.non_max_suppression
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## Scale boxes
:::ultralytics.ops.scale_boxes
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## Scale image
:::ultralytics.ops.scale_image
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## clip boxes
:::ultralytics.ops.clip_boxes
handler: python
options:
show_source: false
show_root_toc_entry: false
---
# Box Format Conversion
## xyxy2xywh
:::ultralytics.ops.xyxy2xywh
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xywh2xyxy
:::ultralytics.ops.xywh2xyxy
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xywhn2xyxy
:::ultralytics.ops.xywhn2xyxy
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xyxy2xywhn
:::ultralytics.ops.xyxy2xywhn
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xyn2xy
:::ultralytics.ops.xyn2xy
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xywh2ltwh
:::ultralytics.ops.xywh2ltwh
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## xyxy2ltwh
:::ultralytics.ops.xyxy2ltwh
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## ltwh2xywh
:::ultralytics.ops.ltwh2xywh
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## ltwh2xyxy
:::ultralytics.ops.ltwh2xyxy
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## segment2box
:::ultralytics.ops.segment2box
handler: python
options:
show_source: false
show_root_toc_entry: false
---
# Mask Operations
## resample_segments
:::ultralytics.ops.resample_segments
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## crop_mask
:::ultralytics.ops.crop_mask
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## process_mask_upsample
:::ultralytics.ops.process_mask_upsample
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## process_mask
:::ultralytics.ops.process_mask
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## process_mask_native
:::ultralytics.ops.process_mask_native
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## scale_segments
:::ultralytics.ops.scale_segments
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## masks2segments
:::ultralytics.ops.masks2segments
handler: python
options:
show_source: false
show_root_toc_entry: false
---
## clip_segments
:::ultralytics.ops.clip_segments
handler: python
options:
show_source: false
show_root_toc_entry: false
---

View File

@ -6,8 +6,7 @@ This is the simplest way of simply using yolo models in a python environment. It
```python
from ultralytics import YOLO
model = YOLO()
model.new("n.yaml") # pass any model type
model = YOLO("yolov8n.yaml")
model(img_tensor) # Or model.forward(). inference.
model.train(data="coco128.yaml", epochs=5)
```
@ -16,10 +15,9 @@ This is the simplest way of simply using yolo models in a python environment. It
```python
from ultralytics import YOLO
model = YOLO()
model.load("n.pt") # pass any model type
model = YOLO("yolov8n.pt") # pass any model type
model(...) # inference
model.train(data="coco128.yaml", epochs=5)
model.train(epochs=5)
```
=== "Resume Training"
@ -35,8 +33,7 @@ This is the simplest way of simply using yolo models in a python environment. It
```python
from ultralytics import YOLO
model = YOLO()
model.load("model.pt")
model = YOLO("model.pt")
model.predict(source="0") # accepts all formats - img/folder/vid.*(mp4/format). 0 for webcam
model.predict(source="folder", view_img=True) # Display preds. Accepts all yolo predict arguments
@ -48,7 +45,7 @@ This is the simplest way of simply using yolo models in a python environment. It
```python
from ultralytics import YOLO
model = YOLO()
model = YOLO("model.pt")
model.fuse()
model.info(verbose=True) # Print model information
model.export(format=) # TODO:
@ -61,7 +58,7 @@ This is the simplest way of simply using yolo models in a python environment. It
To know more about using `YOLO` models, refer Model class refernce
[Model reference](#){ .md-button .md-button--primary}
[Model reference](reference/model.md){ .md-button .md-button--primary}
---
### Customizing Tasks with Trainers