提交 c767fc55 编写于 作者: K Kentaro Wada

Add warning for incompatible version of labelme

上级 612b40df
......@@ -67,6 +67,21 @@ class LabelFile(object):
try:
with open(filename, 'rb' if PY2 else 'r') as f:
data = json.load(f)
version = data.get('version')
if version is None:
logger.warn(
'Loading JSON file ({}) of unknown version'
.format(filename)
)
elif version.split('.')[0] != __version__.split('.')[0]:
logger.warn(
'This JSON file ({}) may be incompatible with '
'current labelme. version in file: {}, '
'current version: {}'.format(
filename, version, __version__
)
)
if data['imageData'] is not None:
imageData = base64.b64decode(data['imageData'])
if PY2 and QT4:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册