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

Fix for flake8

上级 68fb3ebc
...@@ -128,7 +128,7 @@ def main(): ...@@ -128,7 +128,7 @@ def main():
) )
if not args.noviz: if not args.noviz:
captions = [class_names[l] for l in labels] captions = [class_names[label] for label in labels]
viz = imgviz.instances2rgb( viz = imgviz.instances2rgb(
image=img, image=img,
labels=labels, labels=labels,
......
...@@ -78,9 +78,9 @@ def main(): ...@@ -78,9 +78,9 @@ def main():
parser.add_argument( parser.add_argument(
'--labelflags', '--labelflags',
dest='label_flags', dest='label_flags',
help='yaml string of label specific flags OR file containing json ' help=r'yaml string of label specific flags OR file containing json '
'string of label specific flags (ex. {person-\d+: [male, tall], ' r'string of label specific flags (ex. {person-\d+: [male, tall], '
'dog-\d+: [black, brown, white], .*: [occluded]})', # NOQA r'dog-\d+: [black, brown, white], .*: [occluded]})', # NOQA
default=argparse.SUPPRESS, default=argparse.SUPPRESS,
) )
parser.add_argument( parser.add_argument(
...@@ -118,16 +118,16 @@ def main(): ...@@ -118,16 +118,16 @@ def main():
if hasattr(args, 'flags'): if hasattr(args, 'flags'):
if os.path.isfile(args.flags): if os.path.isfile(args.flags):
with codecs.open(args.flags, 'r', encoding='utf-8') as f: with codecs.open(args.flags, 'r', encoding='utf-8') as f:
args.flags = [l.strip() for l in f if l.strip()] args.flags = [line.strip() for line in f if line.strip()]
else: else:
args.flags = [l for l in args.flags.split(',') if l] args.flags = [line for line in args.flags.split(',') if line]
if hasattr(args, 'labels'): if hasattr(args, 'labels'):
if os.path.isfile(args.labels): if os.path.isfile(args.labels):
with codecs.open(args.labels, 'r', encoding='utf-8') as f: with codecs.open(args.labels, 'r', encoding='utf-8') as f:
args.labels = [l.strip() for l in f if l.strip()] args.labels = [line.strip() for line in f if line.strip()]
else: else:
args.labels = [l for l in args.labels.split(',') if l] args.labels = [line for line in args.labels.split(',') if line]
if hasattr(args, 'label_flags'): if hasattr(args, 'label_flags'):
if os.path.isfile(args.label_flags): if os.path.isfile(args.label_flags):
......
...@@ -5,12 +5,13 @@ from qtpy import QtCore ...@@ -5,12 +5,13 @@ from qtpy import QtCore
from qtpy import QtGui from qtpy import QtGui
from qtpy import QtWidgets from qtpy import QtWidgets
QT5 = QT_VERSION[0] == '5' # NOQA
from labelme.logger import logger from labelme.logger import logger
import labelme.utils import labelme.utils
QT5 = QT_VERSION[0] == '5'
# TODO(unknown): # TODO(unknown):
# - Calculate optimal position so as not to go out of screen area. # - Calculate optimal position so as not to go out of screen area.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册