CLI Simplification (#449)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-01-17 23:00:33 +01:00 committed by GitHub
parent 454191bd4b
commit 453b5f259a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 218 additions and 132 deletions

View file

@ -4,37 +4,37 @@ YOLO command line interface is the easiest way to get started.
!!! tip "Syntax"
```bash
yolo task=detect mode=train model=yolov8n.yaml epochs=1 ...
... ... ...
segment predict yolov8n-seg.pt
classify val yolov8n-cls.pt
yolo task=detect mode=train model=yolov8n.yaml args...
classify predict yolov8n-cls.yaml args...
segment val yolov8n-seg.yaml args...
export yolov8n.pt format=onnx args...
```
The experiment arguments can be overridden directly by pass `arg=val` covered in the next section. You can run any
supported task by setting `task` and `mode` in cli.
The default arguments can be overridden directly by passing custom `arg=val` covered in the next section. You can run
any supported task by setting `task` and `mode` in CLI.
=== "Training"
| | `task` | snippet |
|------------------|------------|------------------------------------------------------------|
| Detection | `detect` | <pre><code>yolo task=detect mode=train </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo task=segment mode=train </code></pre> |
| Classification | `classify` | <pre><code>yolo task=classify mode=train </code></pre> |
| Detection | `detect` | <pre><code>yolo detect train </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo segment train </code></pre> |
| Classification | `classify` | <pre><code>yolo classify train </code></pre> |
=== "Prediction"
| | `task` | snippet |
|------------------|------------|--------------------------------------------------------------|
| Detection | `detect` | <pre><code>yolo task=detect mode=predict </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo task=segment mode=predict </code></pre> |
| Classification | `classify` | <pre><code>yolo task=classify mode=predict </code></pre> |
| Detection | `detect` | <pre><code>yolo detect predict </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo segment predict </code></pre> |
| Classification | `classify` | <pre><code>yolo classify predict </code></pre> |
=== "Validation"
| | `task` | snippet |
|------------------|------------|-----------------------------------------------------------|
| Detection | `detect` | <pre><code>yolo task=detect mode=val </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo task=segment mode=val </code></pre> |
| Classification | `classify` | <pre><code>yolo task=classify mode=val </code></pre> |
| Detection | `detect` | <pre><code>yolo detect val </code></pre> |
| Instance Segment | `segment` | <pre><code>yolo segment val </code></pre> |
| Classification | `classify` | <pre><code>yolo classify val </code></pre> |
!!! note ""
@ -44,19 +44,19 @@ supported task by setting `task` and `mode` in cli.
## Overriding default config arguments
All global default arguments can be overriden by simply passing them as arguments in the cli.
Default arguments can be overriden by simply passing them as arguments in the CLI.
!!! tip ""
=== "Syntax"
```bash
yolo task= ... mode= ... {++ arg=val ++}
yolo task mode arg=val...
```
=== "Example"
Perform detection training for `10 epochs` with `learning_rate` of `0.01`
```bash
yolo task=detect mode=train {++ epochs=10 lr0=0.01 ++}
yolo detect train epochs=10 lr0=0.01
```
---
@ -67,23 +67,19 @@ You can override config file entirely by passing a new file. You can create a co
current working dir as follows:
```bash
yolo task=init
yolo copy-config
```
You can then use `cfg=name.yaml` command to pass the new config file
You can then use `cfg=default_copy.yaml` command to pass the new config file along with any addition args:
```bash
yolo cfg=default.yaml
yolo cfg=default_copy.yaml args...
```
??? example
=== "Command"
```bash
yolo task=init
yolo cfg=default.yaml
yolo copy-config
yolo cfg=default_copy.yaml args...
```
=== "Results"
TODO: add terminal output