diff --git a/utils/README.md b/utils/README.md deleted file mode 100644 index d12a378f..00000000 --- a/utils/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Equivalence Testing - -Equivalence testing is to evaluate the similarity of image or audio results. -Before conducting testing, please follow the instructions below to configure the virtual environment. - -## Configure Virtual Environment - -### Create Virtual Environment - -``` -$ python -m venv EquivalenceTest.venv -``` - -### Managing Packages with pip - -``` -$ pip install pillow -$ pip install numpy -$ pip install sys -``` - -## Run Equivalence Tests - -### Image Equivalence Testing - -``` -$ source EquivalenceTest.venv/bin/activate -$ python compareImg.py -$ deactivate -``` - -Example: -``` -$ python compareImg.py $benchmark_bin_dir/BuddyResize_length_500_500_BI.png $benchmark_bin_dir/OpenCVResize_length_500_500_BI.png -``` - - -### Audio Equivalence Testing - -``` -``` \ No newline at end of file diff --git a/validation/.gitignore b/validation/.gitignore new file mode 100644 index 00000000..75b0aaf9 --- /dev/null +++ b/validation/.gitignore @@ -0,0 +1,2 @@ +# Python virtual environment +/*venv diff --git a/validation/ImageProcessing/.gitignore b/validation/ImageProcessing/.gitignore new file mode 100644 index 00000000..75b0aaf9 --- /dev/null +++ b/validation/ImageProcessing/.gitignore @@ -0,0 +1,2 @@ +# Python virtual environment +/*venv diff --git a/utils/compareImg.py b/validation/ImageProcessing/compareImg.py similarity index 93% rename from utils/compareImg.py rename to validation/ImageProcessing/compareImg.py index 4bfa9dd0..3e893116 100644 --- a/utils/compareImg.py +++ b/validation/ImageProcessing/compareImg.py @@ -13,7 +13,7 @@ img1_dim = len(np.array(img1).shape) img2_dim = len(np.array(img2).shape) if img1_dim != img2_dim: - print("Please provide images of the same type. Currently, one is a grayscale image and the other is a color image.") + print("Please provide images of the same type.") # compare picture sizes if img1.size != img2.size: diff --git a/validation/README.md b/validation/README.md index b574e4d5..d2b8297a 100644 --- a/validation/README.md +++ b/validation/README.md @@ -1,8 +1,8 @@ # Correctness Checking Framework -## Python based correctness checking +## [DAP] Python based correctness checking for audio processing -## Environment Setup +### Environment Setup Please build the "AudioValidationLib" target in CMake. It would generate a dynamic library for CFFI to use. @@ -37,3 +37,23 @@ There is no strict rule for adding a test case. The test case should be a python file with a class inherited from AudioTest. You would need to modify CWrapper.cpp to add new function wrappers for the new test case. The class should have a method named "run" which will be invoked by the main.py. + +## [DIP] Python based correctness checking for image processing + +### Environment Setup +``` +$ cd ImageProcessing +$ python -m venv EquivalenceTest.venv +$ source EquivalenceTest.venv/bin/activate +$ pip install pillow +$ pip install numpy +$ pip install sys +$ deactivate +``` + +### Execution +``` +$ source EquivalenceTest.venv/bin/activate +$ python compareImg.py +$ deactivate +```