Update prediction Results docs (#4139)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-08-03 18:44:40 +02:00 committed by GitHub
parent 8870084645
commit 11d0488bf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
107 changed files with 1451 additions and 1317 deletions

View file

@ -10,6 +10,7 @@ import os
import re
from collections import defaultdict
from pathlib import Path
from ultralytics.utils import ROOT
NEW_YAML_DIR = ROOT.parent
@ -44,9 +45,12 @@ def create_markdown(py_filepath, module_path, classes, functions):
header_content += f'---{part}---\n\n'
module_path = module_path.replace('.__init__', '')
md_content = [f'## {class_name}\n---\n### ::: {module_path}.{class_name}\n<br><br>\n' for class_name in classes]
md_content.extend(f'## {func_name}\n---\n### ::: {module_path}.{func_name}\n<br><br>\n' for func_name in functions)
md_content = header_content + '\n'.join(md_content)
module_sep = module_path.replace(".", "/")
url = f'https://github.com/ultralytics/ultralytics/blob/main/{module_sep}.py'
title_content = f'# Reference for `{module_sep}.py`\n\n!!! note\n\n Full source code for this file is available at [{url}]({url}).\n\n'
md_content = [f'---\n## ::: {module_path}.{class_name}\n<br><br>\n' for class_name in classes]
md_content.extend(f'---\n## ::: {module_path}.{func_name}\n<br><br>\n' for func_name in functions)
md_content = header_content + title_content + '\n'.join(md_content)
if not md_content.endswith('\n'):
md_content += '\n'