Skip to content

Commit

Permalink
test_face_recognition.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsimran-Dalal authored Oct 28, 2024
1 parent 3dc29eb commit 88fa4d7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test_face_recognition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
from face_recognition_module import detect_faces, generate_embeddings

class TestFaceRecognition(unittest.TestCase):
def test_detect_faces(self):
# Test with a sample image
image_path = "test_images/sample.jpg"
faces = detect_faces(image_path)
self.assertGreater(len(faces), 0, "No faces detected in the sample image.")

def test_generate_embeddings(self):
# Test with a dummy face data
face_data = "sample_face_data"
embedding = generate_embeddings(face_data)
self.assertIsNotNone(embedding, "Embedding generation failed for the given face data.")
self.assertEqual(len(embedding), 128, "Embedding length should be 128 dimensions.") # Example dimension

if __name__ == "__main__":
unittest.main()

0 comments on commit 88fa4d7

Please sign in to comment.