Skip to content

Commit e7906df

Browse files
committed
Make image_size optional for pyfunc version of generate_detection.
Fix #369
1 parent 15ebc2d commit e7906df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

efficientdet/anchors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def _generate_detections_tf(cls_outputs,
306306
detections: detection results in a tensor with each row representing
307307
[image_id, ymin, xmin, ymax, xmax, score, class]
308308
"""
309+
if not image_size:
310+
raise ValueError('image_size cannot be empty.')
311+
309312
logging.info('Using tf version of post-processing.')
310313
anchor_boxes = tf.gather(anchor_boxes, indices)
311314

@@ -565,7 +568,7 @@ def generate_detections(self,
565568
classes,
566569
image_id,
567570
image_scale,
568-
image_size,
571+
image_size=None,
569572
min_score_thresh=MIN_SCORE_THRESH,
570573
max_boxes_to_draw=MAX_DETECTIONS_PER_IMAGE,
571574
disable_pyfun=None):

0 commit comments

Comments
 (0)