Переглянути джерело

Set --Args_show type to str in coco tools

Bobholamovic 2 роки тому
батько
коміт
aaee5465e1

+ 3 - 4
tools/coco_tools/json_AnnoSta.py

@@ -234,15 +234,14 @@ def get_args():
         default='annotations',
         help='annotation key name in json, default annotations')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))

+ 3 - 4
tools/coco_tools/json_Img2Json.py

@@ -82,15 +82,14 @@ def get_args():
         default='categories',
         help='categories key name in json, default categories')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))

+ 3 - 4
tools/coco_tools/json_ImgSta.py

@@ -103,15 +103,14 @@ def get_args():
         default='images',
         help='image key name in json, default images')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))

+ 3 - 4
tools/coco_tools/json_InfoShow.py

@@ -60,15 +60,14 @@ def get_args():
         default=5,
         help='show number of each sub record')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))

+ 3 - 4
tools/coco_tools/json_Merge.py

@@ -67,15 +67,14 @@ def get_args():
         default=['images', 'annotations'],
         help='json keys that need to merge')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))

+ 3 - 4
tools/coco_tools/json_Split.py

@@ -128,15 +128,14 @@ def get_args():
         default='annotations',
         help='annotation key name in json, default annotations')
     parser.add_argument(
-        '-Args_show',
         '--Args_show',
-        type=bool,
-        default=True,
+        type=str,
+        default='True',
         help='Args_show(default: True), if True, show args info')
 
     args = parser.parse_args()
 
-    if args.Args_show:
+    if args.Args_show.lower() == 'true':
         print('Args'.center(100, '-'))
         for k, v in vars(args).items():
             print('%s = %s' % (k, v))