validate_format functionkeras_cv.bounding_box.validate_format(bounding_boxes, variable_name="bounding_boxes")
validates that a given set of bounding boxes complies with KerasCV format.
For a set of bounding boxes to be valid it must satisfy the following
conditions:
- bounding_boxes must be a dictionary
- contains keys "boxes" and "classes"
- each entry must have matching first two dimensions; representing the batch
axis and the number of boxes per image axis.
- either both "boxes" and "classes" are batched, or both are unbatched.
Additionally, one of the following must be satisfied:
- "boxes" and "classes" are both Ragged
- "boxes" and "classes" are both Dense
- "boxes" and "classes" are unbatched
Arguments
Raises
ValueError if any of the above conditions are not met