Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Works on my machine
zesje
Commits
35209b11
Commit
35209b11
authored
5 years ago
by
RABijl
Browse files
Options
Downloads
Patches
Plain Diff
fixes box size in to always use the same size as the test data
parent
c186d6b5
No related branches found
Branches containing commit
No related tags found
1 merge request
!33
Refactor/global box size
Pipeline
#18418
passed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_pregrader.py
+3
-3
3 additions, 3 deletions
tests/test_pregrader.py
with
3 additions
and
3 deletions
tests/test_pregrader.py
+
3
−
3
View file @
35209b11
...
@@ -29,7 +29,7 @@ def scanned_image_keypoints(scanned_image):
...
@@ -29,7 +29,7 @@ def scanned_image_keypoints(scanned_image):
ids
=
[
"
1 filled
"
,
"
2 empty
"
,
"
3 marked with line
"
,
"
4 completely filled
"
,
ids
=
[
"
1 filled
"
,
"
2 empty
"
,
"
3 marked with line
"
,
"
4 completely filled
"
,
"
5 marked with an x
"
,
"
e marked with a cirle inside
"
])
"
5 marked with an x
"
,
"
e marked with a cirle inside
"
])
def
test_ideal_crops
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
def
test_ideal_crops
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
])
==
result
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
]
,
box_size
=
9
)
==
result
@pytest.mark.parametrize
(
'
box_coords, result
'
,
[((
341
,
471
),
True
),
((
352
,
482
),
True
),
((
448
,
482
),
True
),
@pytest.mark.parametrize
(
'
box_coords, result
'
,
[((
341
,
471
),
True
),
((
352
,
482
),
True
),
((
448
,
482
),
True
),
...
@@ -39,7 +39,7 @@ def test_ideal_crops(box_coords, result, scanned_image_keypoints, scanned_image)
...
@@ -39,7 +39,7 @@ def test_ideal_crops(box_coords, result, scanned_image_keypoints, scanned_image)
"
4 fully filled with the label
"
,
"
6 empty with label
"
,
"
4 fully filled with the label
"
,
"
6 empty with label
"
,
"
7 partially cropped, filled and a part of 6
"
,
"
B empty with cb at the bottom
"
])
"
7 partially cropped, filled and a part of 6
"
,
"
B empty with cb at the bottom
"
])
def
test_shifted_crops
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
def
test_shifted_crops
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
])
==
result
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
]
,
box_size
=
9
)
==
result
@pytest.mark.parametrize
(
'
box_coords, result
'
,
[((
60
,
562
),
True
),
((
107
,
562
),
True
),
@pytest.mark.parametrize
(
'
box_coords, result
'
,
[((
60
,
562
),
True
),
((
107
,
562
),
True
),
...
@@ -47,4 +47,4 @@ def test_shifted_crops(box_coords, result, scanned_image_keypoints, scanned_imag
...
@@ -47,4 +47,4 @@ def test_shifted_crops(box_coords, result, scanned_image_keypoints, scanned_imag
ids
=
[
"
A filled with trailing letter
"
,
"
C filled with letters close
"
,
ids
=
[
"
A filled with trailing letter
"
,
"
C filled with letters close
"
,
"
D blank with trailing letter
"
])
"
D blank with trailing letter
"
])
def
test_trailing_text
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
def
test_trailing_text
(
box_coords
,
result
,
scanned_image_keypoints
,
scanned_image
):
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
])
==
result
assert
pregrader
.
box_is_filled
(
box_coords
,
scanned_image
,
scanned_image_keypoints
[
0
]
,
box_size
=
9
)
==
result
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment