Created
November 29, 2020 23:37
-
-
Save AlexeyGy/2ce7cd1170953d244906d9925e8c6dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script performs a testwise detection of the content of test-images | |
import unittest | |
import cv2 as cv | |
from model import recognize, set_up_inference | |
NET = None | |
class TestDetection(unittest.TestCase): | |
def setUp(self): | |
global NET | |
NET = set_up_inference() | |
def test_detect_givenFullBody_expectDetection(self): | |
img = cv.imread("test-images/person-exists.jpg") | |
self.assertEqual(len(recognize(img, NET)), 1) | |
def test_detect_givenJustFace_expectNoDetections(self): | |
img = cv.imread("test-images/face-exists.jpg") | |
self.assertEqual(recognize(img, NET), []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment