Spaces:
Configuration error
Configuration error
Danila-Pechenev
commited on
Commit
•
c63c2cd
1
Parent(s):
28de88c
Fix paths
Browse files- test/test_model.py +4 -4
test/test_model.py
CHANGED
@@ -7,7 +7,7 @@ from ..app import model
|
|
7 |
model_instance: keras.Model = model.create_model()
|
8 |
|
9 |
|
10 |
-
def template(filename: str) ->
|
11 |
image: Image.Image = Image.open(filename)
|
12 |
width: int
|
13 |
height: int
|
@@ -22,7 +22,7 @@ def test_image_jpg():
|
|
22 |
width: int
|
23 |
height: int
|
24 |
output_image: Image.Image
|
25 |
-
width, height, output_image = template(os.path.join(os.getcwd(), "test_images/test1.jpg"))
|
26 |
|
27 |
assert width == output_image.size[0]
|
28 |
assert height == output_image.size[1]
|
@@ -32,7 +32,7 @@ def test_image_png():
|
|
32 |
width: int
|
33 |
height: int
|
34 |
output_image: Image.Image
|
35 |
-
width, height, output_image = template(os.path.join(os.getcwd(), "test_images/test2.png"))
|
36 |
|
37 |
assert width == output_image.size[0]
|
38 |
assert height == output_image.size[1]
|
@@ -42,7 +42,7 @@ def test_image_jpeg():
|
|
42 |
width: int
|
43 |
height: int
|
44 |
output_image: Image.Image
|
45 |
-
width, height, output_image = template(os.path.join(os.getcwd(), "test_images/test3.jpeg"))
|
46 |
|
47 |
assert width == output_image.size[0]
|
48 |
assert height == output_image.size[1]
|
|
|
7 |
model_instance: keras.Model = model.create_model()
|
8 |
|
9 |
|
10 |
+
def template(filename: str) -> tuple[int, int, Image.Image]:
|
11 |
image: Image.Image = Image.open(filename)
|
12 |
width: int
|
13 |
height: int
|
|
|
22 |
width: int
|
23 |
height: int
|
24 |
output_image: Image.Image
|
25 |
+
width, height, output_image = template(os.path.join(os.getcwd(), "test/test_images/test1.jpg"))
|
26 |
|
27 |
assert width == output_image.size[0]
|
28 |
assert height == output_image.size[1]
|
|
|
32 |
width: int
|
33 |
height: int
|
34 |
output_image: Image.Image
|
35 |
+
width, height, output_image = template(os.path.join(os.getcwd(), "test/test_images/test2.png"))
|
36 |
|
37 |
assert width == output_image.size[0]
|
38 |
assert height == output_image.size[1]
|
|
|
42 |
width: int
|
43 |
height: int
|
44 |
output_image: Image.Image
|
45 |
+
width, height, output_image = template(os.path.join(os.getcwd(), "test/test_images/test3.jpeg"))
|
46 |
|
47 |
assert width == output_image.size[0]
|
48 |
assert height == output_image.size[1]
|