Skip to content

Commit

Permalink
Merge branch 'zm/dm-image-info' into zm/replace-voc-format
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Feb 20, 2020
2 parents b5d4dcd + addd22e commit b872f1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datumaro/datumaro/plugins/coco_format/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _save_image(self, item):
filename += CocoPath.IMAGE_EXT
path = osp.join(self._images_dir, filename)
save_image(path, image)
return path
return filename

def convert(self):
self._make_dirs()
Expand Down
10 changes: 10 additions & 0 deletions datumaro/datumaro/plugins/tf_detection_api_format/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ def _parse_tfrecord_file(cls, filepath, subset_name, images_dir):
path = osp.join(images_dir, frame_filename)
image_params['path'] = path

image_size = None
if frame_height and frame_width:
image_size = (frame_height, frame_width)

image_params = {}
if frame_image and frame_format:
image_params['data'] = lazy_image(frame_image, decode_image)
if frame_filename and images_dir:
image_params['path'] = osp.join(images_dir, frame_filename)

image = None
if image_params:
image = Image(**image_params, size=image_size)
Expand Down

0 comments on commit b872f1c

Please sign in to comment.