From aaee5465e150cdf935841e29c598166cdf2c416c Mon Sep 17 00:00:00 2001 From: Bobholamovic Date: Tue, 8 Nov 2022 22:59:18 +0800 Subject: [PATCH] Set --Args_show type to str in coco tools --- tools/coco_tools/json_AnnoSta.py | 7 +++---- tools/coco_tools/json_Img2Json.py | 7 +++---- tools/coco_tools/json_ImgSta.py | 7 +++---- tools/coco_tools/json_InfoShow.py | 7 +++---- tools/coco_tools/json_Merge.py | 7 +++---- tools/coco_tools/json_Split.py | 7 +++---- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/tools/coco_tools/json_AnnoSta.py b/tools/coco_tools/json_AnnoSta.py index c9f848b..de0f6f1 100644 --- a/tools/coco_tools/json_AnnoSta.py +++ b/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)) diff --git a/tools/coco_tools/json_Img2Json.py b/tools/coco_tools/json_Img2Json.py index 076aa25..d08b3b3 100644 --- a/tools/coco_tools/json_Img2Json.py +++ b/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)) diff --git a/tools/coco_tools/json_ImgSta.py b/tools/coco_tools/json_ImgSta.py index 6775824..56c3144 100644 --- a/tools/coco_tools/json_ImgSta.py +++ b/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)) diff --git a/tools/coco_tools/json_InfoShow.py b/tools/coco_tools/json_InfoShow.py index 436649e..d868478 100644 --- a/tools/coco_tools/json_InfoShow.py +++ b/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)) diff --git a/tools/coco_tools/json_Merge.py b/tools/coco_tools/json_Merge.py index cf43914..348ce94 100644 --- a/tools/coco_tools/json_Merge.py +++ b/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)) diff --git a/tools/coco_tools/json_Split.py b/tools/coco_tools/json_Split.py index 9b872e1..8e860ef 100644 --- a/tools/coco_tools/json_Split.py +++ b/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))