ultralytics 8.0.105 classification hyp fix and new onplot callbacks (#2684)
Co-authored-by: ayush chaurasia <ayush.chaurarsia@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ivan Shcheklein <shcheklein@gmail.com>
This commit is contained in:
parent
b1119d512e
commit
23fc50641c
92 changed files with 378 additions and 206 deletions
|
|
@ -33,9 +33,18 @@ def extract_classes_and_functions(filepath):
|
|||
def create_markdown(py_filepath, module_path, classes, functions):
|
||||
md_filepath = py_filepath.with_suffix('.md')
|
||||
|
||||
# Read existing content and keep header content between first two ---
|
||||
header_content = ""
|
||||
if md_filepath.exists():
|
||||
with open(md_filepath, 'r') as file:
|
||||
existing_content = file.read()
|
||||
header_parts = existing_content.split('---', 2)
|
||||
if len(header_parts) >= 3:
|
||||
header_content = f"{header_parts[0]}---{header_parts[1]}---\n\n"
|
||||
|
||||
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 = "\n".join(md_content)
|
||||
md_content = header_content + "\n".join(md_content)
|
||||
|
||||
os.makedirs(os.path.dirname(md_filepath), exist_ok=True)
|
||||
with open(md_filepath, 'w') as file:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue