Ensure that your bounding boxes comply with the bounding box spec
Ensure that your bounding boxes comply with the bounding box spec
- 원본 링크 : https://keras.io/api/keras_cv/bounding_box/utils/validate_format/
- 최종 확인 : 2024-11-25
validate_format function
keras_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_boxesmust 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
- bounding_boxes: dictionary of bounding boxes according to KerasCV format.
Raises
ValueError if any of the above conditions are not met