adds documentation and contributor

main
Sebastian Yonekura 8 years ago
parent 7d3a673d6a
commit 6f6c271ec3

@ -18,5 +18,6 @@
# Contributors
- **[Victor Salimonov](https://github.com/VikTorSalimonov)**
- **[Sebastián Yonekura](https://github.com/syonekura)**
* Documentation, screencasts

@ -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())

Loading…
Cancel
Save