ultralytics 8.0.103
minor fixes (#2634)
Co-authored-by: kssion <appplus@icloud.com> Co-authored-by: Eli Spizzichino <diramazioni@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: xbkaishui <xxkaishui@gmail.com>
This commit is contained in:
@ -242,13 +242,13 @@ if WINDOWS: # emoji-safe logging
|
||||
LOGGER.addFilter(EmojiFilter())
|
||||
|
||||
|
||||
def yaml_save(file='data.yaml', data=None):
|
||||
def yaml_save(file='data.yaml', data={}):
|
||||
"""
|
||||
Save YAML data to a file.
|
||||
|
||||
Args:
|
||||
file (str, optional): File name. Default is 'data.yaml'.
|
||||
data (dict, optional): Data to save in YAML format. Default is None.
|
||||
data (dict): Data to save in YAML format.
|
||||
|
||||
Returns:
|
||||
None: Data is saved to the specified file.
|
||||
@ -261,7 +261,7 @@ def yaml_save(file='data.yaml', data=None):
|
||||
# Convert Path objects to strings
|
||||
for k, v in data.items():
|
||||
if isinstance(v, Path):
|
||||
dict[k] = str(v)
|
||||
data[k] = str(v)
|
||||
|
||||
# Dump data to file in YAML format
|
||||
with open(file, 'w') as f:
|
||||
|
Reference in New Issue
Block a user