Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fsx950223 committed Dec 21, 2020
1 parent de3d4e5 commit 02d9b47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions efficientdet/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _resize_image_first(self, image, classes, boxes, data, params):

input_processor.image = image
image = input_processor.normalize_image()
return image, boxes, classes
return image, boxes, classes, input_processor.image_scale_to_original

def _resize_image_last(self, image, classes, boxes, data, params):
if self._is_training:
Expand Down Expand Up @@ -371,7 +371,8 @@ def dataset_parser(self, value, example_decoder, anchor_labeler, params):
source_area = tf.shape(image)[0] * tf.shape(image)[1]
target_size = utils.parse_image_size(params['image_size'])
target_area = target_size[0] * target_size[1]
# set condition in order to always process small images first which could speed up pipeline
# set condition in order to always process small
# first which could speed up pipeline
image, boxes, classes, image_scale = tf.cond(source_area > target_area,
lambda: self._resize_image_first(image, classes, boxes, data, params),
lambda: self._resize_image_last(image, classes, boxes, data, params))
Expand Down

0 comments on commit 02d9b47

Please sign in to comment.