Skip to content

Commit

Permalink
ultralytics 8.0.136 refactor and simplify package (ultralytics#3748)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2023
1 parent 8ebe94d commit 620f3eb
Show file tree
Hide file tree
Showing 383 changed files with 4,213 additions and 4,646 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ jobs:
- name: Benchmark DetectionModel
shell: python
run: |
from ultralytics.yolo.utils.benchmarks import benchmark
from ultralytics.utils.benchmarks import benchmark
benchmark(model='${{ matrix.model }}.pt', imgsz=160, half=False, hard_fail=0.26)
- name: Benchmark SegmentationModel
shell: python
run: |
from ultralytics.yolo.utils.benchmarks import benchmark
from ultralytics.utils.benchmarks import benchmark
benchmark(model='${{ matrix.model }}-seg.pt', imgsz=160, half=False, hard_fail=0.30)
- name: Benchmark ClassificationModel
shell: python
run: |
from ultralytics.yolo.utils.benchmarks import benchmark
from ultralytics.utils.benchmarks import benchmark
benchmark(model='${{ matrix.model }}-cls.pt', imgsz=160, half=False, hard_fail=0.36)
- name: Benchmark PoseModel
shell: python
run: |
from ultralytics.yolo.utils.benchmarks import benchmark
from ultralytics.utils.benchmarks import benchmark
benchmark(model='${{ matrix.model }}-pose.pt', imgsz=160, half=False, hard_fail=0.17)
- name: Benchmark Summary
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
import os
import pkg_resources as pkg
import ultralytics
from ultralytics.yolo.utils.checks import check_latest_pypi_version
from ultralytics.utils.checks import check_latest_pypi_version
v_local = pkg.parse_version(ultralytics.__version__).release
v_pypi = pkg.parse_version(check_latest_pypi_version()).release
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
path = model.export(format="onnx") # export the model to ONNX format
```

[Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases). See YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python) for more examples.
[Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases). See YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python) for more examples.

</details>

Expand All @@ -110,7 +110,7 @@ YOLOv8 [Detect](https://docs.ultralytics.com/tasks/detect), [Segment](https://do

<img width="1024" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-tasks.png">

All [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.
All [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.

<details open><summary>Detection</summary>

Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ results = model("https://ultralytics.com/images/bus.jpg") # 对图像进行预
success = model.export(format="onnx") # 将模型导出为 ONNX 格式
```

[模型](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models) 会自动从最新的 Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)中下载。查看 YOLOv8 [Python 文档](https://docs.ultralytics.com/usage/python)以获取更多示例。
[模型](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) 会自动从最新的 Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)中下载。查看 YOLOv8 [Python 文档](https://docs.ultralytics.com/usage/python)以获取更多示例。

</details>

Expand All @@ -110,7 +110,7 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式

<img width="1024" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-tasks.png">

所有[模型](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models)在首次使用时会自动从最新的Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)下载。
所有[模型](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models)在首次使用时会自动从最新的Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)下载。

<details open><summary>检测</summary>

Expand Down
4 changes: 2 additions & 2 deletions docs/build_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re
from collections import defaultdict
from pathlib import Path
from ultralytics.yolo.utils import ROOT
from ultralytics.utils import ROOT

NEW_YAML_DIR = ROOT.parent
CODE_DIR = ROOT
Expand Down Expand Up @@ -39,7 +39,7 @@ def create_markdown(py_filepath, module_path, classes, functions):
with open(md_filepath, 'r') as file:
existing_content = file.read()
header_parts = existing_content.split('---', 2)
if len(header_parts) >= 3:
if 'description:' in header_parts or 'comments:' in header_parts and len(header_parts) >= 3:
header_content = f"{header_parts[0]}---{header_parts[1]}---\n\n"

module_path = module_path.replace('.__init__', '')
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/argoverse.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ The Argoverse dataset is widely used for training and evaluating deep learning m

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Argoverse dataset, the `Argoverse.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/Argoverse.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/Argoverse.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Argoverse dataset, the `Argoverse.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/Argoverse.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/Argoverse.yaml).

!!! example "ultralytics/datasets/Argoverse.yaml"
!!! example "ultralytics/cfg/datasets/Argoverse.yaml"

```yaml
--8<-- "ultralytics/datasets/Argoverse.yaml"
--8<-- "ultralytics/cfg/datasets/Argoverse.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/coco.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ The COCO dataset is widely used for training and evaluating deep learning models

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO dataset, the `coco.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO dataset, the `coco.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml).

!!! example "ultralytics/datasets/coco.yaml"
!!! example "ultralytics/cfg/datasets/coco.yaml"

```yaml
--8<-- "ultralytics/datasets/coco.yaml"
--8<-- "ultralytics/cfg/datasets/coco.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/coco8.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ and [YOLOv8](https://github.com/ultralytics/ultralytics).

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO8 dataset, the `coco8.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco8.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco8.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO8 dataset, the `coco8.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml).

!!! example "ultralytics/datasets/coco8.yaml"
!!! example "ultralytics/cfg/datasets/coco8.yaml"

```yaml
--8<-- "ultralytics/datasets/coco8.yaml"
--8<-- "ultralytics/cfg/datasets/coco8.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/globalwheat2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ The Global Wheat Head Dataset is widely used for training and evaluating deep le

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Global Wheat Head Dataset, the `GlobalWheat2020.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/GlobalWheat2020.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/GlobalWheat2020.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Global Wheat Head Dataset, the `GlobalWheat2020.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/GlobalWheat2020.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/GlobalWheat2020.yaml).

!!! example "ultralytics/datasets/GlobalWheat2020.yaml"
!!! example "ultralytics/cfg/datasets/GlobalWheat2020.yaml"

```yaml
--8<-- "ultralytics/datasets/GlobalWheat2020.yaml"
--8<-- "ultralytics/cfg/datasets/GlobalWheat2020.yaml"
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/datasets/detect/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ If you have your own dataset and would like to use it for training detection mod
You can easily convert labels from the popular COCO dataset format to the YOLO format using the following code snippet:

```python
from ultralytics.yolo.data.converter import convert_coco
from ultralytics.data.converter import convert_coco
convert_coco(labels_dir='../coco/annotations/')
```
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/objects365.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ The Objects365 dataset is widely used for training and evaluating deep learning

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Objects365 Dataset, the `Objects365.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/Objects365.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/Objects365.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the Objects365 Dataset, the `Objects365.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/Objects365.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/Objects365.yaml).

!!! example "ultralytics/datasets/Objects365.yaml"
!!! example "ultralytics/cfg/datasets/Objects365.yaml"

```yaml
--8<-- "ultralytics/datasets/Objects365.yaml"
--8<-- "ultralytics/cfg/datasets/Objects365.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/sku-110k.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ The SKU-110k dataset is widely used for training and evaluating deep learning mo

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the SKU-110K dataset, the `SKU-110K.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/SKU-110K.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/SKU-110K.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. For the case of the SKU-110K dataset, the `SKU-110K.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/SKU-110K.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/SKU-110K.yaml).

!!! example "ultralytics/datasets/SKU-110K.yaml"
!!! example "ultralytics/cfg/datasets/SKU-110K.yaml"

```yaml
--8<-- "ultralytics/datasets/SKU-110K.yaml"
--8<-- "ultralytics/cfg/datasets/SKU-110K.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/visdrone.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ The VisDrone dataset is widely used for training and evaluating deep learning mo

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the Visdrone dataset, the `VisDrone.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/VisDrone.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/VisDrone.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the Visdrone dataset, the `VisDrone.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/VisDrone.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/VisDrone.yaml).

!!! example "ultralytics/datasets/VisDrone.yaml"
!!! example "ultralytics/cfg/datasets/VisDrone.yaml"

```yaml
--8<-- "ultralytics/datasets/VisDrone.yaml"
--8<-- "ultralytics/cfg/datasets/VisDrone.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/voc.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ The VOC dataset is widely used for training and evaluating deep learning models

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the VOC dataset, the `VOC.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/VOC.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/VOC.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the VOC dataset, the `VOC.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/VOC.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/VOC.yaml).

!!! example "ultralytics/datasets/VOC.yaml"
!!! example "ultralytics/cfg/datasets/VOC.yaml"

```yaml
--8<-- "ultralytics/datasets/VOC.yaml"
--8<-- "ultralytics/cfg/datasets/VOC.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/detect/xview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ The xView dataset is widely used for training and evaluating deep learning model

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the xView dataset, the `xView.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/xView.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/xView.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the xView dataset, the `xView.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/xView.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/xView.yaml).

!!! example "ultralytics/datasets/xView.yaml"
!!! example "ultralytics/cfg/datasets/xView.yaml"

```yaml
--8<-- "ultralytics/datasets/xView.yaml"
--8<-- "ultralytics/cfg/datasets/xView.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/pose/coco.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ The COCO-Pose dataset is specifically used for training and evaluating deep lear

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO-Pose dataset, the `coco-pose.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco-pose.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco-pose.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO-Pose dataset, the `coco-pose.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco-pose.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco-pose.yaml).

!!! example "ultralytics/datasets/coco-pose.yaml"
!!! example "ultralytics/cfg/datasets/coco-pose.yaml"

```yaml
--8<-- "ultralytics/datasets/coco-pose.yaml"
--8<-- "ultralytics/cfg/datasets/coco-pose.yaml"
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/datasets/pose/coco8-pose.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ and [YOLOv8](https://github.com/ultralytics/ultralytics).

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO8-Pose dataset, the `coco8-pose.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco8-pose.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/datasets/coco8-pose.yaml).
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO8-Pose dataset, the `coco8-pose.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8-pose.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8-pose.yaml).

!!! example "ultralytics/datasets/coco8-pose.yaml"
!!! example "ultralytics/cfg/datasets/coco8-pose.yaml"

```yaml
--8<-- "ultralytics/datasets/coco8-pose.yaml"
--8<-- "ultralytics/cfg/datasets/coco8-pose.yaml"
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/datasets/pose/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ If you have your own dataset and would like to use it for training pose estimati
Ultralytics provides a convenient conversion tool to convert labels from the popular COCO dataset format to YOLO format:

```python
from ultralytics.yolo.data.converter import convert_coco
from ultralytics.data.converter import convert_coco
convert_coco(labels_dir='../coco/annotations/', use_keypoints=True)
```
Expand Down
Loading

0 comments on commit 620f3eb

Please sign in to comment.