Last active
November 29, 2020 23:50
-
-
Save AlexeyGy/ddc29456e19c656d7805f7b7a2f47946 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
import unittest | |
import cv2 as cv | |
from model import recognize, set_up_inference | |
class TestDetection(unittest.TestCase): | |
def setUp(self): | |
self.net = set_up_inference() | |
def test_detect_givenFullBody_expectDetection(self): | |
img = cv.imread("test-images/person-exists.jpg") | |
self.assertEqual(len(recognize(img, self.net)), 1) | |
def test_detect_givenJustFace_expectNoDetections(self): | |
img = cv.imread("test-images/face-exists.jpg") | |
self.assertEqual(recognize(img, self.net), []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment