From 784036319fb4110622edbe5582208d3444db01c6 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Sun, 1 May 2022 12:59:03 +0800 Subject: [PATCH] Rename to AnnotationsConverter --- tools/{convert_yolo_to_coco.py => convert_txt_to_json.py} | 6 +++--- yolort/utils/{yolo2coco.py => annotations_converter.py} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename tools/{convert_yolo_to_coco.py => convert_txt_to_json.py} (71%) rename yolort/utils/{yolo2coco.py => annotations_converter.py} (98%) diff --git a/tools/convert_yolo_to_coco.py b/tools/convert_txt_to_json.py similarity index 71% rename from tools/convert_yolo_to_coco.py rename to tools/convert_txt_to_json.py index fc7f54371..4a8640156 100644 --- a/tools/convert_yolo_to_coco.py +++ b/tools/convert_txt_to_json.py @@ -2,11 +2,11 @@ import argparse -from yolort.utils.yolo2coco import YOLO2COCO +from yolort.utils.annotations_converter import AnnotationsConverter def get_parser(): - parser = argparse.ArgumentParser("Datasets converter from yolo to coco", add_help=True) + parser = argparse.ArgumentParser("Annotations converter from yolo to coco", add_help=True) parser.add_argument("--data_source", default="./coco128", help="Dataset root path") parser.add_argument("--class_names", default="./coco.name", help="Path of the label names") @@ -21,7 +21,7 @@ def cli_main(): args = parser.parse_args() print(f"Command Line Args: {args}") - converter = YOLO2COCO(args.data_source, args.class_names, split=args.split, year=args.year) + converter = AnnotationsConverter(args.data_source, args.class_names, split=args.split, year=args.year) converter.generate() diff --git a/yolort/utils/yolo2coco.py b/yolort/utils/annotations_converter.py similarity index 98% rename from yolort/utils/yolo2coco.py rename to yolort/utils/annotations_converter.py index ecb7b0b3c..991e163f4 100644 --- a/yolort/utils/yolo2coco.py +++ b/yolort/utils/annotations_converter.py @@ -8,9 +8,9 @@ from PIL import Image -class YOLO2COCO: +class AnnotationsConverter: """ - Convert YOLO labels to MSCOCO JSON labels. + Make a MSCOCO JSON format annotations from YOLO format. Args: root (string): Root directory of the Sintel Dataset