Keras 3 API documentation / KerasCV / Bounding box formats and utilities / Bounding box utilities / Convert a bounding box dictionary to -1 padded Dense tensors

Convert a bounding box dictionary to -1 padded Dense tensors

[source]

to_dense function

keras_cv.bounding_box.to_dense(bounding_boxes, max_boxes=None, default_value=-1)

to_dense converts bounding boxes to Dense tensors

Arguments

  • bounding_boxes: bounding boxes in KerasCV dictionary format.
  • max_boxes: the maximum number of boxes, used to pad tensors to a given shape. This can be used to make object detection pipelines TPU compatible.
  • default_value: the default value to pad bounding boxes with. defaults to -1.