YOLO-World4 / yolo_world /version.py
csmithxc's picture
Upload 146 files
1530901 verified
raw
history blame
744 Bytes
# Copyright (c) Tencent Inc. All rights reserved.
from yolo_world import __version__
def __version_info() -> tuple:
"""Parse a version string into a tuple.
Returns:
tuple[int | str]: The version info, e.g., "1.3.0" is parsed into
(1, 3, 0), and "2.0.0rc1" is parsed into (2, 0, 0, 'rc1').
"""
version_info = []
for x in __version__.split('.'):
if x.isdigit():
version_info.append(int(x))
elif x.find('rc') != -1:
patch_version = x.split('rc')
version_info.append(int(patch_version[0]))
version_info.append(f'rc{patch_version[1]}')
return tuple(version_info)
version_info = __version_info()
__all__ = ['__version__', 'version_info']