From c12c8276a70c5d9757686c4948298e2afe4553e9 Mon Sep 17 00:00:00 2001 From: liuhui29 Date: Thu, 17 Sep 2020 22:53:22 +0800 Subject: [PATCH] fix bug --- tools/create_label_list.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/create_label_list.py b/tools/create_label_list.py index e0da0e820..e5fd266d0 100644 --- a/tools/create_label_list.py +++ b/tools/create_label_list.py @@ -62,9 +62,8 @@ def main(): categories_list = [cat['name'] for cat in anno['categories']] with open(args.outfile_path, 'w') as f: - for cat in categories_list[0:-1]: + for cat in categories_list: f.write(cat + '\n') - f.write(categories_list[-1]) print('lable_list file: {} create done!'.format(args.outfile_path)) if args.dataset_type == 'voc' or args.dataset_type == 'VOC': @@ -88,9 +87,8 @@ def main(): categories_list = sorted(categories_list) with open(args.outfile_path, 'w') as f: - for cat in categories_list[0:-1]: + for cat in categories_list: f.write(cat + '\n') - f.write(categories_list[-1]) print('lable_list file: {} create done!'.format(args.outfile_path)) -- GitLab