tf.keras.utils.bounding_boxes.decode_deltas_to_boxes

Converts bounding boxes from delta format to the specified box_format.

This function decodes bounding box deltas relative to anchors to obtain the final bounding box coordinates. The boxes are encoded in a specific encoded_format (center_yxhw by default) during the decoding process. This allows flexibility in how the deltas are applied to the anchors.

anchors Can be Tensors or Dict[Tensors] where keys are level indices and values are corresponding anchor boxes. The shape of the array/tensor should be (N, 4) where N is the number of anchors. boxes_delta Can be Tensors or Dict[Tensors] Bounding box deltas must have the same type and structure as anchors. The shape of the array/tensor can be (N, 4) or (B, N, 4) where N is the number of boxes.
anchor_format str. The format of the input anchors. (e.g., "xyxy", "xywh", etc.)
box_format str. The desired format for the output boxes. (e.g., "xyxy", "xywh", etc.)
encoded_format str. Raw output format from regression head. Defaults to "center_yxhw".
variance List[floats]. A 4-element array/tensor representing variance factors to scale the box deltas. If provided, the deltas are multiplied by the variance before being applied to the anchors. Defaults to None.
image_shape Tuple[int]. The shape of the image (height, width, 3). When using relative bounding box format for box_format the image_shape is used for normalization.

Decoded box coordinates. The return type matches the box_format.

ValueError If variance is not None and its length is not 4.
ValueError If encoded_format is not "center_xywh" or "center_yxhw".