소스 검색

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)