ultralytics 8.0.92
updates and fixes (#2361)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: introvin <vinod.4166@gmail.com> Co-authored-by: marinmarcillat <58145636+marinmarcillat@users.noreply.github.com> Co-authored-by: BIGBOSS-FOX <47949596+BIGBOSS-FOX@users.noreply.github.com>
This commit is contained in:
@ -259,13 +259,14 @@ def yaml_save(file='data.yaml', data=None):
|
||||
# Create parent directories if they don't exist
|
||||
file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Convert Path objects to strings
|
||||
for k, v in data.items():
|
||||
if isinstance(v, Path):
|
||||
dict[k] = str(v)
|
||||
|
||||
# Dump data to file in YAML format
|
||||
with open(file, 'w') as f:
|
||||
# Dump data to file in YAML format, converting Path objects to strings
|
||||
yaml.safe_dump({k: str(v) if isinstance(v, Path) else v
|
||||
for k, v in data.items()},
|
||||
f,
|
||||
sort_keys=False,
|
||||
allow_unicode=True)
|
||||
yaml.safe_dump(data, f, sort_keys=False, allow_unicode=True)
|
||||
|
||||
|
||||
def yaml_load(file='data.yaml', append_filename=False):
|
||||
@ -759,7 +760,7 @@ ENVIRONMENT = 'Colab' if is_colab() else 'Kaggle' if is_kaggle() else 'Jupyter'
|
||||
TESTS_RUNNING = is_pytest_running() or is_github_actions_ci()
|
||||
set_sentry()
|
||||
|
||||
# OpenCV Multilanguage-friendly functions ------------------------------------------------------------------------------------
|
||||
# OpenCV Multilanguage-friendly functions ------------------------------------------------------------------------------
|
||||
imshow_ = cv2.imshow # copy to avoid recursion errors
|
||||
|
||||
|
||||
|
@ -481,9 +481,6 @@ def feature_visualization(x, module_type, stage, n=32, save_dir=Path('runs/detec
|
||||
stage (int): Module stage within the model.
|
||||
n (int, optional): Maximum number of feature maps to plot. Defaults to 32.
|
||||
save_dir (Path, optional): Directory to save results. Defaults to Path('runs/detect/exp').
|
||||
|
||||
Returns:
|
||||
None: This function does not return any value; it saves the visualization to the specified directory.
|
||||
"""
|
||||
for m in ['Detect', 'Pose', 'Segment']:
|
||||
if m in module_type:
|
||||
|
Reference in New Issue
Block a user