Download testcases/test_recognize_face.py from RajaThor/Project: direct link, hf CLI and curl.
- Browser
- Download file 716 Bytes
-
https://huggingface.co/spaces/RajaThor/Project/resolve/main/testcases/test_recognize_face.py
- Command line
-
hf download hf://spaces/RajaThor/Project/testcases/test_recognize_face.py
-
curl -L -o test_recognize_face.py https://huggingface.co/spaces/RajaThor/Project/resolve/main/testcases/test_recognize_face.py
716 Bytes
| import streamlit.testing as stt | |
| def test_recognize_face(): | |
| with stt.install_test_input(): | |
| stt.test_runner.start("app.py") | |
| # Select the "Recognize Face" option | |
| stt.test_input("Select Option", "Recognize Face") | |
| # Upload an image for face recognition | |
| stt.test_input("Upload Image", "random.jpg") | |
| # Click the "Recognize Face" button | |
| stt.test_input("Recognize Face") | |
| # Verify the recognition result | |
| stt.test_output("It's a picture of John Doe! Insta handle: <a href='https://www.instagram.com/johndoe123/' target='_blank'><font color='red'>johndoe123</font></a>") | |
| # Clean up | |
| stt.test_runner.cleanup() | |
| test_recognize_face() |