|
@@ -15,8 +15,12 @@ from labelme.utils import newIcon
|
|
|
|
|
|
def main():
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser = argparse.ArgumentParser()
|
|
- parser.add_argument('--version', '-V', action='store_true',
|
|
|
|
- help='show version')
|
|
|
|
|
|
+ parser.add_argument(
|
|
|
|
+ '--version', '-V', action='store_true', help='show version'
|
|
|
|
+ )
|
|
|
|
+ parser.add_argument(
|
|
|
|
+ '--reset-config', action='store_true', help='reset qt config'
|
|
|
|
+ )
|
|
parser.add_argument('filename', nargs='?', help='image or label filename')
|
|
parser.add_argument('filename', nargs='?', help='image or label filename')
|
|
parser.add_argument('--output', '-O', '-o', help='output label name')
|
|
parser.add_argument('--output', '-O', '-o', help='output label name')
|
|
default_config_file = os.path.join(os.path.expanduser('~'), '.labelmerc')
|
|
default_config_file = os.path.join(os.path.expanduser('~'), '.labelmerc')
|
|
@@ -99,6 +103,7 @@ def main():
|
|
|
|
|
|
config_from_args = args.__dict__
|
|
config_from_args = args.__dict__
|
|
config_from_args.pop('version')
|
|
config_from_args.pop('version')
|
|
|
|
+ reset_config = config_from_args.pop('reset_config')
|
|
filename = config_from_args.pop('filename')
|
|
filename = config_from_args.pop('filename')
|
|
output = config_from_args.pop('output')
|
|
output = config_from_args.pop('output')
|
|
config_file = config_from_args.pop('config_file')
|
|
config_file = config_from_args.pop('config_file')
|
|
@@ -114,6 +119,12 @@ def main():
|
|
app.setApplicationName(__appname__)
|
|
app.setApplicationName(__appname__)
|
|
app.setWindowIcon(newIcon('icon'))
|
|
app.setWindowIcon(newIcon('icon'))
|
|
win = MainWindow(config=config, filename=filename, output=output)
|
|
win = MainWindow(config=config, filename=filename, output=output)
|
|
|
|
+
|
|
|
|
+ if reset_config:
|
|
|
|
+ print('Resetting Qt config: %s' % win.settings.fileName())
|
|
|
|
+ win.settings.clear()
|
|
|
|
+ sys.exit(0)
|
|
|
|
+
|
|
win.show()
|
|
win.show()
|
|
win.raise_()
|
|
win.raise_()
|
|
sys.exit(app.exec_())
|
|
sys.exit(app.exec_())
|