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
76adcc2c
Commit
76adcc2c
authored
5 years ago
by
Richard
Browse files
Options
Downloads
Patches
Plain Diff
fix demo hopelijk
parent
b3fa241e
No related branches found
No related tags found
No related merge requests found
Pipeline
#18954
failed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zesje/pregrader.py
+5
-3
5 additions, 3 deletions
zesje/pregrader.py
with
5 additions
and
3 deletions
zesje/pregrader.py
+
5
−
3
View file @
76adcc2c
...
...
@@ -6,6 +6,7 @@ from .blanks import get_blank
from
.database
import
db
,
Grader
,
FeedbackOption
,
GradingPolicy
from
.images
import
guess_dpi
,
get_box
from
.pdf_generation
import
CHECKBOX_FORMAT
import
sys
def
grade_problem
(
sub
,
page
,
page_img
):
...
...
@@ -153,11 +154,12 @@ def is_blank(problem, page_img, sub):
while
n
+
50
<
max
:
m
=
n
+
50
if
np
.
average
(
~
input_image
[
n
:
m
])
>
(
1.03
*
np
.
average
(
~
blank_image
[
n
:
m
])):
print
(
f
"
input:
{
np
.
average
(
~
input_image
[
n
:
m
])
}
, blank:
{
np
.
average
(
~
reference
[
n
:
m
])
}
"
,
file
=
sys
.
stdout
)
if
np
.
average
(
~
input_image
[
n
:
m
])
>
(
1.1
*
np
.
average
(
~
blank_image
[
n
:
m
]))
and
np
.
average
(
~
input_image
[
n
:
m
])
>
1
:
return
False
n
=
m
return
not
(
np
.
average
(
~
input_image
[
n
:
max
-
1
])
>
(
1.
03
*
np
.
average
(
~
blank_image
[
n
:
max
-
1
])))
print
(
f
"
input:
{
np
.
average
(
~
input_image
[
n
:
max
-
1
])
}
, blank:
{
np
.
average
(
~
blank_image
[
n
:
max
-
1
])
}
"
,
file
=
sys
.
stdout
)
return
not
(
np
.
average
(
~
input_image
[
n
:
max
-
1
])
>
(
1.
1
*
np
.
average
(
~
blank_image
[
n
:
max
-
1
]))
and
np
.
average
(
~
input_image
[
n
:
max
-
1
])
>
1
)
def
box_is_filled
(
box
,
page_img
,
threshold
=
225
,
cut_padding
=
0.05
,
box_size
=
9
):
...
...
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