def apply_hflip_box3d(hflip_tfm, box3d):  # pylint: disable=unused-argument
    """Horizontally flip 3D box.

    CAVEAT: This function makes assumption about the object symmetry wrt *y=0* plane.

    new quaternion: [quat.z, -quat.y, -quat.x, quat.w]
    https://stackoverflow.com/questions/32438252/efficient-way-to-apply-mirror-effect-on-quaternion-rotation

    Parameters
    ----------
    hflip_tfm: HFlipTransform

    box3d: np.array
        10D representation of 3D box. quaternion (4) + location (3) + dimension (3)

    Returns
    -------
    np.array
        10D representation of flipped 3D box.
    """
    quat, tvec, dims = box3d[:4], box3d[4:7], box3d[7:]

    quat_new = np.float32([quat[3], -quat[2], -quat[1], quat[0]])
    tvec_new = tvec.copy()
    tvec_new[0] = -tvec_new[0]
    dims_new = dims.copy()
    return np.concatenate([quat_new, tvec_new, dims_new])
Horizontally flip 3D box.

    CAVEAT: This function makes assumption about the object symmetry wrt *y=0* plane.

    new quaternion: [quat.z, -quat.y, -quat.x, quat.w]
    https://stackoverflow.com/questions/32438252/efficient-way-to-apply-mirror-effect-on-quaternion-rotation

    Parameters
    ----------
    hflip_tfm: HFlipTransform

    box3d: np.array
        10D representation of 3D box. quaternion (4) + location (3) + dimension (3)

    Returns
    -------
    np.array
        10D representation of flipped 3D box.
    
tridet/data/augmentations/flip_transform.py