-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
d0884e1
commit 83dd933
Showing
2 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
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.") | ||
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 | ||
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() | ||
|