浏览代码

Stop overwriting provided config with default args

Kentaro Wada 7 年之前
父节点
当前提交
071e052416
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      labelme/app.py

+ 11 - 0
labelme/app.py

@@ -1242,6 +1242,17 @@ def main():
     filename = config_from_args.pop('filename')
     output = config_from_args.pop('output')
     config_file = config_from_args.pop('config_file')
+    # drop the default config
+    if not config_from_args['auto_save']:
+        config_from_args.pop('auto_save')
+    if config_from_args['store_data']:
+        config_from_args.pop('store_data')
+    if not config_from_args['labels']:
+        config_from_args.pop('labels')
+    if not config_from_args['sort_labels']:
+        config_from_args.pop('sort_labels')
+    if not config_from_args['validate_label']:
+        config_from_args.pop('validate_label')
     config = get_config(config_from_args, config_file)
 
     app = QtWidgets.QApplication(sys.argv)