Skip to content

Instantly share code, notes, and snippets.

@AlexeyGy
Last active November 29, 2020 23:50
Show Gist options
  • Save AlexeyGy/ddc29456e19c656d7805f7b7a2f47946 to your computer and use it in GitHub Desktop.
Save AlexeyGy/ddc29456e19c656d7805f7b7a2f47946 to your computer and use it in GitHub Desktop.
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