Example #1
0
def test_class_constructor():
    bbox = BBox.from_xywh(1, 1, 5, 5)
    assert isinstance(bbox, BBox)

    bbox = NormalizedBBox.from_xywh(0.1, 0.1, 0.5, 0.5)
    assert isinstance(bbox, NormalizedBBox)
Example #2
0
def test_from_xywh():
    bbox = BBox.from_xywh(5, 6, 10, 30)
    assert bbox.xmin == 5
    assert bbox.xmax == 15
    assert bbox.ymin == 6
    assert bbox.ymax == 36