Пример #1
0
def test_to_from_bytes(image):
    net = Network.load('tiny-yolo')
    data = net.to_bytes()
    results = net(image)
    loaded = Network().from_bytes(data)
    results2 = net(image)
    assert results == results2
Пример #2
0
def test_evaluate(image, box_labels):
    net = Network.load("tiny-yolo")
    acc = net.evaluate([image], [box_labels])
    assert 'fp' in acc
    assert 'fn' in acc
    assert 'tp' in acc
    assert 'r' in acc
    assert 'p' in acc
    assert 'f' in acc
Пример #3
0
def test_update(image, box_labels):
    net = Network.load("tiny-yolo")
    for i in range(10):
        loss = net.update([image], [box_labels])
        print(loss)
Пример #4
0
def test_detection_data(image, box_labels):
    net = Network.load("tiny-yolo")
    data = DetectionData([image], [box_labels], net.width, net.height,
                         net.max_boxes, net.num_classes)
Пример #5
0
def test_detect(image):
    net = Network.load("tiny-yolo")
    result = net(image)
Пример #6
0
def test_load():
    net = Network.load("tiny-yolo")
Пример #7
0
def test_init():
    nn = Network()
Пример #8
0
def test_update(image, box_labels):
    net = Network.load("tiny-yolo")
    for i in range(10):
        loss = net.update([image], [box_labels])
        print(loss)
Пример #9
0
def test_detection_data(image, box_labels):
    net = Network.load("tiny-yolo")
    data = DetectionData([image], [box_labels],
                         net.width, net.height, net.max_boxes, net.num_classes)
Пример #10
0
def test_detect(image):
    net = Network.load("tiny-yolo")
    result = net(image)
Пример #11
0
def test_from_disk(image):
    net = Network().from_disk(Path('lightnet/data/tiny-yolo').resolve())
    results = net(image)
    assert results is not None
Пример #12
0
def test_load():
    net = Network.load("tiny-yolo")