-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
105 lines (91 loc) · 3.97 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Ultralytics YOLO 🚀, AGPL-3.0 license
import re
from pathlib import Path
from setuptools import setup
# Settings
FILE = Path(__file__).resolve()
PARENT = FILE.parent # root directory
README = (PARENT / 'README.md').read_text(encoding='utf-8')
def get_version():
"""
Retrieve the version number from the 'ultralytics/__init__.py' file.
Returns:
(str): The version number extracted from the '__version__' attribute in the 'ultralytics/__init__.py' file.
"""
file = PARENT / 'ultralytics/__init__.py'
return re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', file.read_text(encoding='utf-8'), re.M)[1]
def parse_requirements(file_path: Path):
"""
Parse a requirements.txt file, ignoring lines that start with '#' and any text after '#'.
Args:
file_path (str | Path): Path to the requirements.txt file.
Returns:
(List[str]): List of parsed requirements.
"""
requirements = []
for line in Path(file_path).read_text().splitlines():
line = line.strip()
if line and not line.startswith('#'):
requirements.append(line.split('#')[0].strip()) # ignore inline comments
return requirements
setup(
name='ultralytics', # name of pypi package
version=get_version(), # version of pypi package
python_requires='>=3.8',
license='AGPL-3.0',
description=('Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, '
'pose estimation and image classification.'),
long_description=README,
long_description_content_type='text/markdown',
url='https://github.com/ultralytics/ultralytics',
project_urls={
'Bug Reports': 'https://github.com/ultralytics/ultralytics/issues',
'Funding': 'https://ultralytics.com',
'Source': 'https://github.com/ultralytics/ultralytics'},
author='Ultralytics',
author_email='[email protected]',
packages=['ultralytics'] + [str(x) for x in Path('ultralytics').rglob('*/') if x.is_dir() and '__' not in str(x)],
package_data={
'': ['*.yaml'],
'ultralytics.assets': ['*.jpg']},
include_package_data=True,
install_requires=parse_requirements(PARENT / 'requirements.txt'),
extras_require={
'dev': [
'ipython',
'check-manifest',
'pre-commit',
'pytest',
'pytest-cov',
'coverage',
'mkdocs-material',
'mkdocstrings[python]',
'mkdocs-redirects', # for 301 redirects
'mkdocs-ultralytics-plugin>=0.0.34', # for meta descriptions and images, dates and authors
],
'export': [
'coremltools>=7.0',
'openvino-dev>=2023.0',
'tensorflow<=2.13.1', # TF bug https://github.com/ultralytics/ultralytics/issues/5161
'tensorflowjs', # automatically installs tensorflow
], },
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Image Recognition',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows', ],
keywords='machine-learning, deep-learning, vision, ML, DL, AI, YOLO, YOLOv3, YOLOv5, YOLOv8, HUB, Ultralytics',
entry_points={'console_scripts': ['yolo = ultralytics.cfg:entrypoint', 'ultralytics = ultralytics.cfg:entrypoint']})