ultralytics 8.0.136
refactor and simplify package (#3748)
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:
@ -40,7 +40,7 @@ for (result, frame) in model.track/predict():
|
||||
|
||||
## All callbacks
|
||||
|
||||
Here are all supported callbacks. See callbacks [source code](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/yolo/utils/callbacks/base.py) for additional details.
|
||||
Here are all supported callbacks. See callbacks [source code](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/base.py) for additional details.
|
||||
|
||||
### Trainer Callbacks
|
||||
|
||||
|
@ -38,7 +38,7 @@ Where:
|
||||
- `MODE` (required) is one of `[train, val, predict, export, track, benchmark]`
|
||||
- `ARGS` (optional) are any number of custom `arg=value` pairs like `imgsz=320` that override defaults.
|
||||
For a full list of available `ARGS` see the [Configuration](cfg.md) page and `defaults.yaml`
|
||||
GitHub [source](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/yolo/cfg/default.yaml).
|
||||
GitHub [source](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/default.yaml).
|
||||
|
||||
#### Tasks
|
||||
|
||||
|
@ -70,7 +70,7 @@ Where:
|
||||
- `MODE` (required) is one of `[train, val, predict, export, track]`
|
||||
- `ARGS` (optional) are any number of custom `arg=value` pairs like `imgsz=320` that override defaults.
|
||||
For a full list of available `ARGS` see the [Configuration](cfg.md) page and `defaults.yaml`
|
||||
GitHub [source](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/yolo/cfg/default.yaml).
|
||||
GitHub [source](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/default.yaml).
|
||||
|
||||
!!! warning "Warning"
|
||||
|
||||
|
@ -15,14 +15,14 @@ custom model and dataloader by just overriding these functions:
|
||||
|
||||
* `get_model(cfg, weights)` - The function that builds the model to be trained
|
||||
* `get_dataloder()` - The function that builds the dataloader
|
||||
More details and source code can be found in [`BaseTrainer` Reference](../reference/yolo/engine/trainer.md)
|
||||
More details and source code can be found in [`BaseTrainer` Reference](../reference/engine/trainer.md)
|
||||
|
||||
## DetectionTrainer
|
||||
|
||||
Here's how you can use the YOLOv8 `DetectionTrainer` and customize it.
|
||||
|
||||
```python
|
||||
from ultralytics.yolo.v8.detect import DetectionTrainer
|
||||
from ultralytics.models.yolo.detect import DetectionTrainer
|
||||
|
||||
trainer = DetectionTrainer(overrides={...})
|
||||
trainer.train()
|
||||
@ -35,7 +35,7 @@ Let's customize the trainer **to train a custom detection model** that is not su
|
||||
simply overloading the existing the `get_model` functionality:
|
||||
|
||||
```python
|
||||
from ultralytics.yolo.v8.detect import DetectionTrainer
|
||||
from ultralytics.models.yolo.detect import DetectionTrainer
|
||||
|
||||
|
||||
class CustomTrainer(DetectionTrainer):
|
||||
@ -54,7 +54,7 @@ You now realize that you need to customize the trainer further to:
|
||||
Here's how you can do it:
|
||||
|
||||
```python
|
||||
from ultralytics.yolo.v8.detect import DetectionTrainer
|
||||
from ultralytics.models.yolo.detect import DetectionTrainer
|
||||
from ultralytics.nn.tasks import DetectionModel
|
||||
|
||||
|
||||
|
@ -240,7 +240,7 @@ their specific use case based on their requirements for speed and accuracy.
|
||||
|
||||
Benchmark an official YOLOv8n model across all export formats.
|
||||
```python
|
||||
from ultralytics.yolo.utils.benchmarks import benchmark
|
||||
from ultralytics.utils.benchmarks import benchmark
|
||||
|
||||
# Benchmark
|
||||
benchmark(model='yolov8n.pt', imgsz=640, half=False, device=0)
|
||||
@ -256,7 +256,7 @@ from `BaseTrainer`.
|
||||
!!! tip "Detection Trainer Example"
|
||||
|
||||
```python
|
||||
from ultralytics.yolo import v8 import DetectionTrainer, DetectionValidator, DetectionPredictor
|
||||
from ultralytics.models.yolo import DetectionTrainer, DetectionValidator, DetectionPredictor
|
||||
|
||||
# trainer
|
||||
trainer = DetectionTrainer(overrides={})
|
||||
|
Reference in New Issue
Block a user