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

Fixing Pascal VOC to BigML-COCO annotations translator #260

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
History
-------

5.8.1 (2024-05-31)
~~~~~~~~~~~~~~~~~~

- Fixing Pascal VOC to BigML-COCO translator.

5.8.0 (2024-04-05)
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion bigmler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '5.8.0'
__version__ = '5.8.1'
6 changes: 3 additions & 3 deletions bigmler/processing/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ def bigml_coco_file(args, session_file):

def get_image_info(annotation_root):
"""Returns the basic image descriptors"""
filename = annotation_root.findtext('filename')
path = annotation_root.findtext('path')
if path is None:
filename = annotation_root.findtext('filename')
else:
if filename is None and path is not None:
filename = os.path.basename(path)
img_name = os.path.basename(filename)
img_id = os.path.splitext(img_name)[0]
Expand Down Expand Up @@ -530,6 +529,7 @@ def voc_to_cocojson(voc_dir, args, session_file):
if args.images_dir is not None:
base_dir = os.path.join(base_dir, args.images_dir)
image_filename_base = os.path.join(folder, img_info['filename'])
filename = image_filename_base
if args.images_dir is not None:
filename = os.path.join(base_dir, image_filename_base)

Expand Down
1 change: 1 addition & 0 deletions data/images/VOC_annotations/000004.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<annotation>
<folder>f1</folder>
<filename>fruits1b.png</filename>
<path>C:\fruits1b.png</path>
<source>
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
Expand Down
Loading