ultralytics 8.0.149 add Open Images V7 training (#4178)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: AdiEcho <30563671+AdiEcho@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-08-07 01:19:51 +02:00
committed by GitHub
parent c751c7f88a
commit 7565210484
110 changed files with 969 additions and 144 deletions

View File

@ -359,6 +359,19 @@ DEFAULT_CFG_KEYS = DEFAULT_CFG_DICT.keys()
DEFAULT_CFG = IterableSimpleNamespace(**DEFAULT_CFG_DICT)
def is_ubuntu() -> bool:
"""
Check if the OS is Ubuntu.
Returns:
(bool): True if OS is Ubuntu, False otherwise.
"""
with contextlib.suppress(FileNotFoundError):
with open('/etc/os-release') as f:
return 'ID=ubuntu' in f.read()
return False
def is_colab():
"""
Check if the current script is running inside a Google Colab notebook.
@ -550,6 +563,19 @@ def get_default_args(func):
return {k: v.default for k, v in signature.parameters.items() if v.default is not inspect.Parameter.empty}
def get_ubuntu_version():
"""
Retrieve the Ubuntu version if the OS is Ubuntu.
Returns:
(str): Ubuntu version or None if not an Ubuntu OS.
"""
with contextlib.suppress(FileNotFoundError, AttributeError):
with open('/etc/os-release') as f:
return re.search(r'VERSION_ID="(\d+\.\d+)"', f.read())[1]
return None
def get_user_config_dir(sub_dir='Ultralytics'):
"""
Get the user config directory.

View File

@ -51,6 +51,7 @@ def check_imgsz(imgsz, stride=32, min_dim=1, max_dim=2, floor=0):
imgsz (int | cList[int]): Image size.
stride (int): Stride value.
min_dim (int): Minimum number of dimensions.
max_dim (int): Maximum number of dimensions.
floor (int): Minimum allowed value for image size.
Returns: