from __future__ import print_functionimport distutils.spawnimport osimport reimport shleximport subprocessimport sysfrom setuptools import find_packagesfrom setuptools import setupdef get_version():filename = "labelme/__init__.py"with open(filename) as f:match = re.search(r"""^__version__ = ['"]([^'"]*)['"]""", f.read(), re.M)if not match:raise RuntimeError("{} doesn't contain __version__".format(filename))version = match.groups()[0]return versiondef get_install_requires():PY3 = sys.version_info[0] == 3PY2 = sys.version_info[0] == 2assert PY3 or PY2install_requires = ["imgviz>=0.11","matplotlib<3.3", # for PyInstaller"numpy","Pillow>=2.8","PyYAML","qtpy!=1.11.2","termcolor",]# Find python binding for qt with priority:# PyQt5 -> PySide2 -> PyQt4,# and PyQt5 is automatically installed on Python3.QT_BINDING = Nonetry:import PyQt5 # NOQAQT_BINDING = "pyqt5"except ImportError:passif QT_BINDING is None:try:import PySide2 # NOQAQT_BINDING = "pyside2"except ImportError:passif QT_BINDING is None:try:import PyQt4 # NOQAQT_BINDING = "pyqt4"except ImportError:if PY2:print("Please install PyQt5, PySide2 or PyQt4 for Python2.\n""Note that PyQt5 can be installed via pip for Python3.",file=sys.stderr,)sys.exit(1)assert PY3# PyQt5 can be installed via pip for Python3# 5.15.3, 5.15.4 won't work with PyInstallerinstall_requires.append("PyQt5!=5.15.3,!=5.15.4")QT_BINDING = "pyqt5"del QT_BINDINGif os.name == "nt": # Windowsinstall_requires.append("colorama")return install_requiresdef get_long_description():with open("README.md") as f:long_description = f.read()try:import github2pypireturn github2pypi.replace_url(slug="wkentaro/labelme", content=long_description)except Exception:return long_descriptiondef main():version = get_version()if sys.argv[1] == "release":if not distutils.spawn.find_executable("twine"):print("Please install twine:\n\n\tpip install twine\n",file=sys.stderr,)sys.exit(1)commands = ["python tests/docs_tests/man_tests/test_labelme_1.py","git push origin main","git tag v{:s}".format(version),"git push origin --tags","python setup.py sdist","twine upload dist/labelme-{:s}.tar.gz".format(version),]for cmd in commands:print("+ {:s}".format(cmd))subprocess.check_call(shlex.split(cmd))sys.exit(0)setup(name="labelme",version=version,packages=find_packages(exclude=["github2pypi"]),description="Image Polygonal Annotation with Python",long_description=get_long_description(),long_description_content_type="text/markdown",author="Kentaro Wada",author_email="www.kentaro.wada@gmail.com",url="https://github.com/wkentaro/labelme",install_requires=get_install_requires(),license="GPLv3",keywords="Image Annotation, Machine Learning",classifiers=["Development Status :: 5 - Production/Stable","Intended Audience :: Developers","Natural Language :: English","Programming Language :: Python","Programming Language :: Python :: 2.7","Programming Language :: Python :: 3.5","Programming Language :: Python :: 3.6","Programming Language :: Python :: 3.7","Programming Language :: Python :: Implementation :: CPython","Programming Language :: Python :: Implementation :: PyPy",],package_data={"labelme": ["icons/*", "config/*.yaml"]},entry_points={"console_scripts": ["labelme=labelme.__main__:main","labelme_draw_json=labelme.cli.draw_json:main","labelme_draw_label_png=labelme.cli.draw_label_png:main","labelme_json_to_dataset=labelme.cli.json_to_dataset:main","labelme_on_docker=labelme.cli.on_docker:main",],},data_files=[("share/man/man1", ["docs/man/labelme.1"])],)if __name__ == "__main__":main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。