Add Docs build to Ultralytics CI (#10388)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
99f8e863ed
commit
156b6be8d3
4 changed files with 19 additions and 2 deletions
15
.github/workflows/ci.yaml
vendored
15
.github/workflows/ci.yaml
vendored
|
|
@ -43,6 +43,21 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
Docs:
|
||||||
|
runs-on: macos-14
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
cache: "pip" # caching pip dependencies
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: pip install tqdm mkdocs-material "mkdocstrings[python]" mkdocs-jupyter mkdocs-redirects mkdocs-ultralytics-plugin
|
||||||
|
- name: Build Docs and Check for Warnings
|
||||||
|
run: python docs/build_docs.py
|
||||||
|
|
||||||
HUB:
|
HUB:
|
||||||
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.hub == 'true'))
|
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.hub == 'true'))
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ def build_docs(clone_repos=True):
|
||||||
|
|
||||||
# Build the main documentation
|
# Build the main documentation
|
||||||
print(f"Building docs from {DOCS}")
|
print(f"Building docs from {DOCS}")
|
||||||
subprocess.run(f"mkdocs build -f {DOCS.parent}/mkdocs.yml", check=True, shell=True)
|
subprocess.run(f"mkdocs build -f {DOCS.parent}/mkdocs.yml --strict", check=True, shell=True)
|
||||||
print(f"Site built at {SITE}")
|
print(f"Site built at {SITE}")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ def create_markdown(py_filepath: Path, module_path: str, classes: list, function
|
||||||
title_content = (
|
title_content = (
|
||||||
f"# Reference for `{module_path}.py`\n\n"
|
f"# Reference for `{module_path}.py`\n\n"
|
||||||
f"!!! Note\n\n"
|
f"!!! Note\n\n"
|
||||||
f" This file is available at [{url}]({url}). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request]({edit}) 🛠️. Thank you 🙏!\n\n"
|
f" This file is available at [{url}]({url}). If you spot a problem please help fix it by [contributing]"
|
||||||
|
f"(https://docs.ultralytics.com/help/contributing/) a [Pull Request]({edit}) 🛠️. Thank you 🙏!\n\n"
|
||||||
)
|
)
|
||||||
md_content = ["<br><br>\n"] + [f"## ::: {module_name}.{class_name}\n\n<br><br>\n" for class_name in classes]
|
md_content = ["<br><br>\n"] + [f"## ::: {module_name}.{class_name}\n\n<br><br>\n" for class_name in classes]
|
||||||
md_content.extend(f"## ::: {module_name}.{func_name}\n\n<br><br>\n" for func_name in functions)
|
md_content.extend(f"## ::: {module_name}.{func_name}\n\n<br><br>\n" for func_name in functions)
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,7 @@ def test_model_embeddings():
|
||||||
|
|
||||||
@pytest.mark.skipif(checks.IS_PYTHON_3_12, reason="YOLOWorld with CLIP is not supported in Python 3.12")
|
@pytest.mark.skipif(checks.IS_PYTHON_3_12, reason="YOLOWorld with CLIP is not supported in Python 3.12")
|
||||||
def test_yolo_world():
|
def test_yolo_world():
|
||||||
|
"""Tests YOLO world models with different configurations, including classes, detection, and training scenarios."""
|
||||||
model = YOLO("yolov8s-world.pt") # no YOLOv8n-world model yet
|
model = YOLO("yolov8s-world.pt") # no YOLOv8n-world model yet
|
||||||
model.set_classes(["tree", "window"])
|
model.set_classes(["tree", "window"])
|
||||||
model(ASSETS / "bus.jpg", conf=0.01)
|
model(ASSETS / "bus.jpg", conf=0.01)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue