예제 #1
0
def test_sample_images():
    variables = ['x', 'y', 'w', 'h']
    vision = Vision()
    with open('sample_img/tests.csv', 'r') as csvfile:
        # filename, x, y, w, h
        testreader = csv.reader(csvfile, delimiter=',')
        for sample in testreader:
            image = cv2.imread('sample_img/' + sample[0])
            # Rescale if necessary
            scaled = cv2.resize(image, (Vision.video_width, Vision.video_height))
            results = vision._vision_process.findTarget(scaled)
            yield find_target, sample[0], results[:-1], sample[1:], [0.05, 0.05]  # Don't send the return image
    vision.free()