Skip to content

Commit

Permalink
Rename to AnnotationsConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqwang committed May 1, 2022
1 parent 34bb53b commit 1848178
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import argparse

from yolort.utils.yolo2coco import YOLO2COCO
from yolort.utils 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")
Expand All @@ -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()


Expand Down
6 changes: 4 additions & 2 deletions yolort/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url

from .annotations_converter import AnnotationsConverter
from .dependency import check_version
from .hooks import FeatureExtractor
from .image_utils import cv2_imshow, get_image_from_url, read_image_to_tensor
from .visualizer import Visualizer


__all__ = [
"AnnotationsConverter",
"FeatureExtractor",
"Visualizer",
"check_version",
"contains_any_tensor",
"cv2_imshow",
"get_image_from_url",
"get_callable_dict",
"load_state_dict_from_url",
"read_image_to_tensor",
"FeatureExtractor",
"Visualizer",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1848178

Please sign in to comment.