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
9d46ed71
Commit
9d46ed71
authored
5 years ago
by
Ruben Young On
Browse files
Options
Downloads
Patches
Plain Diff
fix_corner_markers now raises runtime error if fewer than 3 corner markers are found
parent
e9a90c01
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Add pregrading
Pipeline
#17948
passed
5 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
zesje/images.py
+1
-1
1 addition, 1 deletion
zesje/images.py
zesje/pregrader.py
+0
-1
0 additions, 1 deletion
zesje/pregrader.py
zesje/scans.py
+6
-1
6 additions, 1 deletion
zesje/scans.py
with
7 additions
and
3 deletions
zesje/images.py
+
1
−
1
View file @
9d46ed71
...
@@ -59,7 +59,7 @@ def fix_corner_markers(corner_keypoints, shape):
...
@@ -59,7 +59,7 @@ def fix_corner_markers(corner_keypoints, shape):
"""
"""
if
len
(
corner_keypoints
)
==
4
or
len
(
corner_keypoints
)
<
3
:
if
len
(
corner_keypoints
)
==
4
or
len
(
corner_keypoints
)
<
3
:
r
eturn
corner_keypoints
r
aise
RuntimeError
(
"
Fewer then 3 corner markers found
"
)
x_sep
=
shape
[
1
]
/
2
x_sep
=
shape
[
1
]
/
2
y_sep
=
shape
[
0
]
/
2
y_sep
=
shape
[
0
]
/
2
...
...
This diff is collapsed.
Click to expand it.
zesje/pregrader.py
+
0
−
1
View file @
9d46ed71
...
@@ -22,7 +22,6 @@ def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):
...
@@ -22,7 +22,6 @@ def add_feedback_to_solution(sub, exam, page, page_img, corner_keypoints):
"""
"""
problems_on_page
=
[
problem
for
problem
in
exam
.
problems
if
problem
.
widget
.
page
==
page
]
problems_on_page
=
[
problem
for
problem
in
exam
.
problems
if
problem
.
widget
.
page
==
page
]
# TODO: What if less than 3 keypoints are found?
top_left_point
,
fixed_corner_keypoints
=
fix_corner_markers
(
corner_keypoints
,
page_img
.
shape
)
top_left_point
,
fixed_corner_keypoints
=
fix_corner_markers
(
corner_keypoints
,
page_img
.
shape
)
for
problem
in
problems_on_page
:
for
problem
in
problems_on_page
:
...
...
This diff is collapsed.
Click to expand it.
zesje/scans.py
+
6
−
1
View file @
9d46ed71
...
@@ -339,7 +339,12 @@ def process_page(image_data, exam_config, output_dir=None, strict=False):
...
@@ -339,7 +339,12 @@ def process_page(image_data, exam_config, output_dir=None, strict=False):
return
True
,
"
Testing, image not saved and database not updated.
"
return
True
,
"
Testing, image not saved and database not updated.
"
sub
,
exam
=
update_database
(
image_path
,
barcode
)
sub
,
exam
=
update_database
(
image_path
,
barcode
)
add_feedback_to_solution
(
sub
,
exam
,
barcode
.
page
,
image_array
,
corner_keypoints
)
try
:
add_feedback_to_solution
(
sub
,
exam
,
barcode
.
page
,
image_array
,
corner_keypoints
)
except
RuntimeError
as
e
:
if
strict
:
return
False
,
str
(
e
)
if
barcode
.
page
==
0
:
if
barcode
.
page
==
0
:
description
=
guess_student
(
description
=
guess_student
(
...
...
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