Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
176a6775
Commit
176a6775
authored
2 years ago
by
Inga Kirschnick
Browse files
Options
Downloads
Patches
Plain Diff
small fixes
parent
95028915
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/daemon/job_utils.py
+1
-2
1 addition, 2 deletions
app/daemon/job_utils.py
app/services/forms.py
+13
-12
13 additions, 12 deletions
app/services/forms.py
app/services/services.yml
+1
-0
1 addition, 0 deletions
app/services/services.yml
with
15 additions
and
14 deletions
app/daemon/job_utils.py
+
1
−
2
View file @
176a6775
...
...
@@ -65,6 +65,7 @@ def _create_job_service(job):
command
+=
f
'
-m
{
job
.
service_args
[
"
model
"
]
}
'
if
'
binarization
'
in
job
.
service_args
and
job
.
service_args
[
'
binarization
'
]:
command
+=
'
--binarize
'
if
'
ocropus_nlbin_threshold
'
in
job
.
service_args
and
job
.
service_args
[
'
ocropus_nlbin_threshold
'
]:
value
=
job
.
service_args
[
'
ocropus_nlbin_threshold
'
]
command
+=
f
'
--ocropus-nlbin-threshold
{
value
}
'
elif
job
.
service
==
'
transkribus-htr-pipeline
'
:
...
...
@@ -146,8 +147,6 @@ def _create_job_service(job):
)
'''
## Restart policy ##
'''
restart_policy
=
docker
.
types
.
RestartPolicy
()
print
(
command
)
print
(
mounts
)
try
:
docker_client
.
services
.
create
(
image
,
...
...
This diff is collapsed.
Click to expand it.
app/services/forms.py
+
13
−
12
View file @
176a6775
from
flask_login
import
current_user
from
flask_wtf
import
FlaskForm
from
flask_wtf.file
import
FileField
,
FileRequired
from
wtforms
import
(
BooleanField
,
DecimalRangeField
,
MultipleFileField
,
SelectField
,
StringField
,
SubmitField
,
ValidationError
)
from
wtforms
import
(
BooleanField
,
DecimalRangeField
,
MultipleFileField
,
SelectField
,
StringField
,
SubmitField
,
ValidationError
)
from
wtforms.validators
import
InputRequired
,
Length
from
app.models
import
TesseractOCRPipelineModel
,
SpaCyNLPPipelineModel
from
app.models
import
SpaCyNLPPipelineModel
,
TesseractOCRPipelineModel
from
.
import
SERVICES
...
...
@@ -51,7 +46,7 @@ class CreateTesseractOCRPipelineJobForm(CreateJobBaseForm):
pdf
=
FileField
(
'
File
'
,
validators
=
[
FileRequired
()])
model
=
SelectField
(
'
Model
'
,
validators
=
[
InputRequired
()])
ocropus_nlbin_threshold
=
DecimalRangeField
(
render_kw
=
{
'
min
'
:
0
,
'
max
'
:
1
,
'
step
'
:
0.1
,
'
start
'
:
[
0.5
]}
render_kw
=
{
'
min
'
:
0
,
'
max
'
:
1
,
'
step
'
:
0.1
,
'
start
'
:
[
0.5
]
,
'
disabled
'
:
True
}
)
def
validate_binarization
(
self
,
field
):
...
...
@@ -59,7 +54,7 @@ class CreateTesseractOCRPipelineJobForm(CreateJobBaseForm):
if
field
.
data
:
if
not
(
'
methods
'
in
service_info
and
'
binarization
'
in
service_info
[
'
methods
'
]):
raise
ValidationError
(
'
Binarization is not available
'
)
def
validate_pdf
(
self
,
field
):
if
field
.
data
.
mimetype
!=
'
application/pdf
'
:
raise
ValidationError
(
'
PDF files only!
'
)
...
...
@@ -72,10 +67,16 @@ class CreateTesseractOCRPipelineJobForm(CreateJobBaseForm):
if
self
.
binarization
.
render_kw
is
None
:
self
.
binarization
.
render_kw
=
{}
self
.
binarization
.
render_kw
[
'
disabled
'
]
=
True
if
self
.
ocropus_nlbin_threshold
.
render_kw
is
None
:
self
.
ocropus_nlbin_threshold
.
render_kw
=
{}
self
.
ocropus_nlbin_threshold
.
render_kw
[
'
disabled
'
]
=
True
if
'
methods
'
in
service_info
:
if
'
binarization
'
in
service_info
[
'
methods
'
]:
if
'
disabled
'
in
self
.
binarization
.
render_kw
:
del
self
.
binarization
.
render_kw
[
'
disabled
'
]
if
'
ocropus_nlbin_threshold
'
in
service_info
[
'
methods
'
]:
if
'
disabled
'
in
self
.
ocropus_nlbin_threshold
.
render_kw
:
del
self
.
ocropus_nlbin_threshold
.
render_kw
[
'
disabled
'
]
models
=
[
x
for
x
in
TesseractOCRPipelineModel
.
query
.
order_by
(
TesseractOCRPipelineModel
.
title
).
all
()
if
version
in
x
.
compatible_service_versions
and
(
x
.
shared
==
True
or
x
.
user
==
current_user
)
...
...
This diff is collapsed.
Click to expand it.
app/services/services.yml
+
1
−
0
View file @
176a6775
...
...
@@ -20,6 +20,7 @@ tesseract-ocr-pipeline:
0.1.1
:
methods
:
-
'
binarization'
-
'
ocropus_nlbin_threshold'
publishing_year
:
2022
url
:
'
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/tesseract-ocr-pipeline/-/releases/v0.1.1'
transkribus-htr-pipeline
:
...
...
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