Skip to content

Commit

Permalink
[DIP] Add image processing correctness test.
Browse files Browse the repository at this point in the history
  • Loading branch information
taiqzheng committed Jul 3, 2023
1 parent cfb5794 commit 9eeaeb2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 44 deletions.
41 changes: 0 additions & 41 deletions utils/README.md

This file was deleted.

2 changes: 2 additions & 0 deletions validation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Python virtual environment
/*venv
2 changes: 2 additions & 0 deletions validation/ImageProcessing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Python virtual environment
/*venv
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 22 additions & 2 deletions validation/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 <PATH/TO/Image1> <PATH/TO/Image2>
$ deactivate
```

0 comments on commit 9eeaeb2

Please sign in to comment.