コード例 #1
0
ファイル: conftest.py プロジェクト: sh4d0w777/ComputerVision
def od_sample_detection_bboxes():
    return [
        DetectionBbox.from_array(
            [109.0, 190.0, 205.0, 408.0],
            label_idx=3,
            label_name="carton",
            score=0.9985,
        ),
        DetectionBbox.from_array(
            [340.0, 326.0, 465.0, 549.0],
            label_idx=2,
            label_name="milk_bottle",
            score=0.9979,
        ),
        DetectionBbox.from_array(
            [214.0, 181.0, 315.0, 460.0],
            label_idx=1,
            label_name="can",
            score=0.9945,
        ),
        DetectionBbox.from_array(
            [215.0, 193.0, 316.0, 471.0],
            label_idx=2,
            label_name="milk_bottle",
            score=0.1470,
        ),
        DetectionBbox.from_array(
            [109.0, 209.0, 209.0, 420.0],
            label_idx=1,
            label_name="can",
            score=0.0903,
        ),
    ]
コード例 #2
0
def det_bbox() -> "DetectionBbox":
    return DetectionBbox(left=0,
                         top=10,
                         right=100,
                         bottom=1000,
                         label_idx=0,
                         score=0.5)
コード例 #3
0
def od_cup_det_bboxes(tmp_session, od_cup_path) -> List[DetectionBbox]:
    return [
        DetectionBbox(
            left=61,
            top=59,
            right=273,
            bottom=244,
            label_name="cup",
            label_idx=0,
            im_path=od_cup_path,
            score=0.99,
        )
    ]
コード例 #4
0
def test_detection_bbox_from_array(det_bbox):
    bbox_from_array = DetectionBbox.from_array([0, 10, 100, 1000],
                                               label_idx=0,
                                               score=0)
    validate_bbox(det_bbox)
    assert type(bbox_from_array) == DetectionBbox