diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 787a65e9..548c8091 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -18,5 +18,6 @@ # Contributors - **[Victor Salimonov](https://github.com/VikTorSalimonov)** +- **[Sebastián Yonekura](https://github.com/syonekura)** * Documentation, screencasts diff --git a/cvat/scripts/pascal_voc.py b/cvat/scripts/pascal_voc.py index f7603310..cd9cc4c4 100644 --- a/cvat/scripts/pascal_voc.py +++ b/cvat/scripts/pascal_voc.py @@ -6,6 +6,15 @@ from pascal_voc_writer import Writer def process_cvat_xml(xml_file, img_dir, annotation_dir): + """ + Transforms a single XML in CVAT format to multiple PASCAL VOC format + XMls. + + :param xml_file: CVAT format XML + :param img_dir: image directory of the dataset + :param annotation_dir: directory of annotations with PASCAL VOC format + :return: + """ os.makedirs(annotation_dir) cvat_xml = xml.etree.ElementTree.parse(xml_file) @@ -33,9 +42,10 @@ def process_cvat_xml(xml_file, img_dir, annotation_dir): parser = argparse.ArgumentParser(description='Transforms CVAT XML to Pascal ' 'VOC format') -parser.add_argument('cvat_xml', type=argparse.FileType()) -parser.add_argument('img_dir') -parser.add_argument('annotation_dir') +parser.add_argument('cvat_xml', type=argparse.FileType(), help='CVAT XML file') +parser.add_argument('img_dir', help='Image directory of the dataset') +parser.add_argument('annotation_dir', help='Output directory of ' + 'XML annotations') if __name__ == '__main__': args = vars(parser.parse_args())