def polygon_allclose(poly1, poly2):
    """
    Test whether two polygons are the same.
    Both arguments are nx2 numpy arrays.
    """
    # ABCD and CDAB are the same polygon. So it's important to check after rolling
    for k in range(len(poly1)):
        rolled_poly1 = np.roll(poly1, k, axis=0)
        if np.allclose(rolled_poly1, poly2):
            return True
    return False

    Test whether two polygons are the same.
    Both arguments are nx2 numpy arrays.
    
video_chat_text/video_chat_with_ChatGPT/models/grit_src/third_party/CenterNet2/tests/data/test_transforms.py