Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOC converter: Use depth from CVAT XML if available #885

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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