Keras 3 API 文档 / KerasCV / 边界框格式和工具 / 边界框工具 / 将边界框字典转换为-1填充的密集张量

将边界框字典转换为-1填充的密集张量

[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.