Skip to content

Commit

Permalink
VOC converter: Use depth from CVAT XML if available (cvat-ai#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre authored and Chris Lee-Messer committed Mar 5, 2020
1 parent d3948cb commit 6247509
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/voc/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ def process_cvat_xml(xml_file, image_dir, output_dir):
image_name = img_tag.get('name')
width = img_tag.get('width')
height = img_tag.get('height')
depth = img_tag.get('depth', 3)
image_path = os.path.join(image_dir, image_name)
if not os.path.exists(image_path):
log.warn('{} image cannot be found. Is `{}` image directory correct?'.
format(image_path, image_dir))
writer = Writer(image_path, width, height)
writer = Writer(image_path, width, height, depth=depth)

unknown_tags = {x.tag for x in img_tag.iter()}.difference(KNOWN_TAGS)
if unknown_tags:
Expand Down

0 comments on commit 6247509

Please sign in to comment.