Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不会修仙的道士
labelme
提交
37bfe442
L
labelme
项目概览
不会修仙的道士
/
labelme
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
labelme
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
37bfe442
编写于
1月 24, 2020
作者:
K
Kentaro Wada
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move __version__ to __init__.py
上级
132eb8af
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
130 addition
and
126 deletion
+130
-126
labelme/__init__.py
labelme/__init__.py
+6
-3
labelme/_version.py
labelme/_version.py
+0
-5
labelme/label_file.py
labelme/label_file.py
+1
-1
setup.py
setup.py
+123
-117
未找到文件。
labelme/__init__.py
浏览文件 @
37bfe442
...
...
@@ -8,6 +8,12 @@ from qtpy import QT_VERSION
__appname__
=
'labelme'
# Semantic Versioning 2.0.0: https://semver.org/
# 1. MAJOR version when you make incompatible API changes;
# 2. MINOR version when you add functionality in a backwards-compatible manner;
# 3. PATCH version when you make backwards-compatible bug fixes.
__version__
=
'3.21.1'
QT4
=
QT_VERSION
[
0
]
==
'4'
QT5
=
QT_VERSION
[
0
]
==
'5'
del
QT_VERSION
...
...
@@ -16,9 +22,6 @@ PY2 = sys.version[0] == '2'
PY3
=
sys
.
version
[
0
]
==
'3'
del
sys
from
labelme._version
import
__version__
from
labelme.label_file
import
LabelFile
from
labelme
import
testing
from
labelme
import
utils
labelme/_version.py
已删除
100644 → 0
浏览文件 @
132eb8af
# Semantic Versioning 2.0.0: https://semver.org/
# 1. MAJOR version when you make incompatible API changes;
# 2. MINOR version when you add functionality in a backwards-compatible manner;
# 3. PATCH version when you make backwards-compatible bug fixes.
__version__
=
'3.21.1'
labelme/label_file.py
浏览文件 @
37bfe442
...
...
@@ -5,7 +5,7 @@ import os.path as osp
import
PIL.Image
from
labelme
._version
import
__version__
from
labelme
import
__version__
from
labelme.logger
import
logger
from
labelme
import
PY2
from
labelme
import
QT4
...
...
setup.py
浏览文件 @
37bfe442
from
__future__
import
print_function
import
distutils.spawn
import
os.path
import
re
from
setuptools
import
find_packages
from
setuptools
import
setup
import
shlex
...
...
@@ -9,90 +9,70 @@ import subprocess
import
sys
PY3
=
sys
.
version_info
[
0
]
==
3
PY2
=
sys
.
version_info
[
0
]
==
2
assert
PY3
or
PY2
here
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
version_file
=
os
.
path
.
join
(
here
,
'labelme'
,
'_version.py'
)
if
PY3
:
import
importlib
version
=
importlib
.
machinery
.
SourceFileLoader
(
'_version'
,
version_file
).
load_module
().
__version__
else
:
assert
PY2
import
imp
version
=
imp
.
load_source
(
'_version'
,
version_file
).
__version__
del
here
install_requires
=
[
'imgviz>=0.10.2'
,
'matplotlib'
,
'numpy'
,
'Pillow>=2.8.0'
,
'PyYAML'
,
'qtpy'
,
'termcolor'
,
]
# Find python binding for qt with priority:
# PyQt5 -> PySide2 -> PyQt4,
# and PyQt5 is automatically installed on Python3.
QT_BINDING
=
None
try
:
import
PyQt5
# NOQA
QT_BINDING
=
'pyqt5'
except
ImportError
:
pass
if
QT_BINDING
is
None
:
try
:
import
PySide2
# NOQA
QT_BINDING
=
'pyside2'
except
ImportError
:
pass
def
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
version
def
get_install_requires
():
PY3
=
sys
.
version_info
[
0
]
==
3
PY2
=
sys
.
version_info
[
0
]
==
2
assert
PY3
or
PY2
install_requires
=
[
'imgviz>=0.10.2'
,
'matplotlib'
,
'numpy'
,
'Pillow>=2.8.0'
,
'PyYAML'
,
'qtpy'
,
'termcolor'
,
]
# Find python binding for qt with priority:
# PyQt5 -> PySide2 -> PyQt4,
# and PyQt5 is automatically installed on Python3.
QT_BINDING
=
None
if
QT_BINDING
is
None
:
try
:
import
PyQt4
# NOQA
QT_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
install_requires
.
append
(
'PyQt5'
)
import
PyQt5
# NOQA
QT_BINDING
=
'pyqt5'
del
QT_BINDING
except
ImportError
:
pass
if
sys
.
argv
[
1
]
==
'release'
:
if
not
distutils
.
spawn
.
find_executable
(
'twine'
):
print
(
'Please install twine:
\n\n\t
pip install twine
\n
'
,
file
=
sys
.
stderr
,
)
sys
.
exit
(
1
)
commands
=
[
'python tests/docs_tests/man_tests/test_labelme_1.py'
,
'git tag v{:s}'
.
format
(
version
),
'git push origin master --tag'
,
'python setup.py sdist'
,
'twine upload dist/labelme-{:s}.tar.gz'
.
format
(
version
),
]
for
cmd
in
commands
:
subprocess
.
check_call
(
shlex
.
split
(
cmd
))
sys
.
exit
(
0
)
if
QT_BINDING
is
None
:
try
:
import
PySide2
# NOQA
QT_BINDING
=
'pyside2'
except
ImportError
:
pass
if
QT_BINDING
is
None
:
try
:
import
PyQt4
# NOQA
QT_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
install_requires
.
append
(
'PyQt5'
)
QT_BINDING
=
'pyqt5'
del
QT_BINDING
return
install_requires
def
get_long_description
():
...
...
@@ -107,40 +87,66 @@ def get_long_description():
return
long_description
setup
(
name
=
'labelme'
,
version
=
version
,
packages
=
find_packages
(),
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
=
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'
,
def
main
():
version
=
get_version
()
if
sys
.
argv
[
1
]
==
'release'
:
if
not
distutils
.
spawn
.
find_executable
(
'twine'
):
print
(
'Please install twine:
\n\n\t
pip install twine
\n
'
,
file
=
sys
.
stderr
,
)
sys
.
exit
(
1
)
commands
=
[
'python tests/docs_tests/man_tests/test_labelme_1.py'
,
'git tag v{:s}'
.
format
(
version
),
'git push origin master --tag'
,
'python setup.py sdist'
,
'twine upload dist/labelme-{:s}.tar.gz'
.
format
(
version
),
]
for
cmd
in
commands
:
subprocess
.
check_call
(
shlex
.
split
(
cmd
))
sys
.
exit
(
0
)
setup
(
name
=
'labelme'
,
version
=
version
,
packages
=
find_packages
(),
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'
,
],
},
data_files
=
[(
'share/man/man1'
,
[
'docs/man/labelme.1'
])],
)
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
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录