From 91d02f1ecb012c75c5628d0c106ca3904b9cc7b0 Mon Sep 17 00:00:00 2001 From: Brian Bjarke Jensen Date: Sat, 24 Feb 2024 11:58:37 +0100 Subject: [PATCH] tested random prediction generation --- tests/test_generate_random_prediction.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/test_generate_random_prediction.py diff --git a/tests/test_generate_random_prediction.py b/tests/test_generate_random_prediction.py new file mode 100644 index 0000000..f2a2845 --- /dev/null +++ b/tests/test_generate_random_prediction.py @@ -0,0 +1,17 @@ +from pathlib import Path + +from src.database import VisualCommunication + + +if __name__ == "__main__": + # get list of image paths + test_dir = Path(__file__).parent + img_dir = test_dir / "imgs" + img_path_list = [path for path in img_dir.glob("*.jpeg") if path.is_file()] + print(img_path_list) + # instantiate data object + vis_com_list = [VisualCommunication.from_file(path) for path in img_path_list] + # generate random predictions + [vis_com.generate_random_prediction() for vis_com in vis_com_list] + for vis_com in vis_com_list: + print(vis_com) \ No newline at end of file