haritsahm commited on
Commit
dd0a580
·
1 Parent(s): dbe6ca0

Update test script

Browse files
Files changed (1) hide show
  1. tests/test_image_reader.py +5 -1
tests/test_image_reader.py CHANGED
@@ -5,6 +5,8 @@ import numpy as np
5
  import pytest
6
  from PIL import Image
7
 
 
 
8
 
9
  @pytest.mark.parametrize('dtype,extension,dim', [
10
  (np.uint8, '.png', 1),
@@ -31,7 +33,9 @@ def test_image_reader(dtype, extension, dim):
31
  image_r = np.array(Image.open(tf.name))
32
  image_r = cv2.normalize(
33
  image_r, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U)
 
 
34
 
35
  assert image_r.dtype == np.uint8
36
- assert image_r.shape[:2] == (225, 225)
37
  assert np.min(image_r) >= 0 and np.max(image_r) <= 255
 
5
  import pytest
6
  from PIL import Image
7
 
8
+ INPUT_HEIGHT, INPUT_WIDTH = 600, 500
9
+
10
 
11
  @pytest.mark.parametrize('dtype,extension,dim', [
12
  (np.uint8, '.png', 1),
 
33
  image_r = np.array(Image.open(tf.name))
34
  image_r = cv2.normalize(
35
  image_r, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U)
36
+ image_r = cv2.resize(
37
+ image_r, (INPUT_WIDTH, INPUT_HEIGHT), interpolation=cv2.INTER_LINEAR)
38
 
39
  assert image_r.dtype == np.uint8
40
+ assert image_r.shape[:2] == (INPUT_HEIGHT, INPUT_WIDTH)
41
  assert np.min(image_r) >= 0 and np.max(image_r) <= 255