|
|
@ -568,9 +568,10 @@ def get_user_config_dir(sub_dir='Ultralytics'):
|
|
|
|
raise ValueError(f'Unsupported operating system: {platform.system()}')
|
|
|
|
raise ValueError(f'Unsupported operating system: {platform.system()}')
|
|
|
|
|
|
|
|
|
|
|
|
# GCP and AWS lambda fix, only /tmp is writeable
|
|
|
|
# GCP and AWS lambda fix, only /tmp is writeable
|
|
|
|
if not is_dir_writeable(str(path.parent)):
|
|
|
|
if not is_dir_writeable(path.parent):
|
|
|
|
path = Path('/tmp') / sub_dir
|
|
|
|
LOGGER.warning(f"WARNING ⚠️ user config directory '{path}' is not writeable, defaulting to '/tmp' or CWD."
|
|
|
|
LOGGER.warning(f"WARNING ⚠️ user config directory is not writeable, defaulting to '{path}'.")
|
|
|
|
'Alternatively you can define a YOLO_CONFIG_DIR environment variable for this path.')
|
|
|
|
|
|
|
|
path = Path('/tmp') / sub_dir if is_dir_writeable('/tmp') else Path().cwd() / sub_dir
|
|
|
|
|
|
|
|
|
|
|
|
# Create the subdirectory if it does not exist
|
|
|
|
# Create the subdirectory if it does not exist
|
|
|
|
path.mkdir(parents=True, exist_ok=True)
|
|
|
|
path.mkdir(parents=True, exist_ok=True)
|
|
|
@ -578,7 +579,7 @@ def get_user_config_dir(sub_dir='Ultralytics'):
|
|
|
|
return path
|
|
|
|
return path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
USER_CONFIG_DIR = Path(os.getenv('YOLO_CONFIG_DIR', get_user_config_dir())) # Ultralytics settings dir
|
|
|
|
USER_CONFIG_DIR = Path(os.getenv('YOLO_CONFIG_DIR') or get_user_config_dir()) # Ultralytics settings dir
|
|
|
|
SETTINGS_YAML = USER_CONFIG_DIR / 'settings.yaml'
|
|
|
|
SETTINGS_YAML = USER_CONFIG_DIR / 'settings.yaml'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|