We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cece47e commit 535c624Copy full SHA for 535c624
examples/training/object_detection/pascal_voc/retina_net.py
@@ -227,7 +227,7 @@ def apply(inputs):
227
bounding_boxes = keras_cv.bounding_box.convert_format(
228
boxes, images=image, source="yxyx", target=bounding_box_format
229
)
230
- bounding_boxes = {"boxes": boxes, "classes": classes}
+ bounding_boxes = {"boxes": bounding_boxes, "classes": classes}
231
return image, bounding_boxes
232
233
return apply
@@ -278,10 +278,13 @@ def apply(inputs):
278
279
280
281
-def pad_fn(images, boxes):
282
- boxes = boxes.to_tensor(default_value=-1.0, shape=[GLOBAL_BATCH_SIZE, 32, 5])
283
- boxes = boxes[:, :, :4]
284
- classes = boxes[:, :, 4]
+def pad_fn(images, bounding_boxes):
+ boxes = bounding_boxes["boxes"].to_tensor(
+ default_value=-1.0, shape=[GLOBAL_BATCH_SIZE, 32, 4]
+ )
285
+ classes = bounding_boxes["classes"].to_tensor(
286
+ default_value=-1.0, shape=[GLOBAL_BATCH_SIZE, 32]
287
288
return images, {"boxes": boxes, "classes": classes}
289
290
0 commit comments