Create test_recognize_face_optimal.py
Browse files
test_recognize_face_optimal.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit.testing as stt
|
| 2 |
+
|
| 3 |
+
def test_recognize_face_optimal():
|
| 4 |
+
with stt.install_test_input():
|
| 5 |
+
stt.test_runner.start("path_to_your_script.py")
|
| 6 |
+
|
| 7 |
+
# Select the "Recognize Face (Optimal)" option
|
| 8 |
+
stt.test_input("Select Option", "Recognize Face (Optimal)")
|
| 9 |
+
|
| 10 |
+
# Upload an image for optimal face recognition
|
| 11 |
+
stt.test_input("Upload Image", "path_to_image.jpg")
|
| 12 |
+
|
| 13 |
+
# Click the "Recognize Face (Optimal)" button
|
| 14 |
+
stt.test_input("Recognize Face (Optimal)")
|
| 15 |
+
|
| 16 |
+
# Verify the optimal recognition result
|
| 17 |
+
stt.test_output("Best match: John Doe with a similarity score of 97.50%. Insta handle: <a href='https://www.instagram.com/johndoe123/' target='_blank'><font color='red'>johndoe123</font></a>")
|
| 18 |
+
|
| 19 |
+
# Clean up
|
| 20 |
+
stt.test_runner.cleanup()
|
| 21 |
+
|
| 22 |
+
test_recognize_face_optimal()
|