Skip to content

Commit 97f82ac

Browse files
committed
Replace tf.repeat with tf.tile for better compatibility.
Fix #286 PiperOrigin-RevId: 307888162
1 parent 247825e commit 97f82ac

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

efficientdet/anchors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _generate_detections_tf(cls_outputs,
335335
width = boxes[:, 3] - boxes[:, 1]
336336

337337
detections = tf.stack([
338-
tf.cast(tf.repeat(image_id, tf.size(top_detection_idx)), tf.float32),
338+
tf.cast(tf.tile(image_id, [tf.size(top_detection_idx)]), tf.float32),
339339
boxes[:, 0] * image_scale,
340340
boxes[:, 1] * image_scale,
341341
height * image_scale,

efficientdet/model_inspect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ def saved_model_inference(self, image_path_pattern, output_dir, **kwargs):
188188
batch_files = all_files[i * batch_size: (i + 1) * batch_size]
189189
raw_images = [np.array(Image.open(f)) for f in batch_files]
190190
detections_bs = driver.serve_images(raw_images)
191-
print(len(raw_images), len(detections_bs))
192191
for j in range(len(raw_images)):
193192
img = driver.visualize(raw_images[j], detections_bs[j], **kwargs)
194193
img_id = str(i * batch_size + j)
File renamed without changes.

0 commit comments

Comments
 (0)