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
9da08508
Commit
9da08508
authored
4 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Add changes for new OCR and NLP Pipelines
parent
498defa3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/jobs/forms.py
+5
-9
5 additions, 9 deletions
app/jobs/forms.py
app/services/views.py
+2
-2
2 additions, 2 deletions
app/services/views.py
app/templates/services/ocr.html.j2
+1
-1
1 addition, 1 deletion
app/templates/services/ocr.html.j2
with
8 additions
and
12 deletions
app/jobs/forms.py
+
5
−
9
View file @
9da08508
...
@@ -21,9 +21,7 @@ class AddNLPJobForm(FlaskForm):
...
@@ -21,9 +21,7 @@ class AddNLPJobForm(FlaskForm):
validators
=
[
DataRequired
()])
validators
=
[
DataRequired
()])
submit
=
SubmitField
()
submit
=
SubmitField
()
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
version
=
SelectField
(
'
Version
'
,
version
=
SelectField
(
'
Version
'
,
choices
=
[(
'
latest
'
,
'
Latest
'
)],
choices
=
[(
'
2.2.0
'
,
'
Latest (2.2.0)
'
),
(
'
2.2.0
'
,
'
2.2.0
'
)],
validators
=
[
DataRequired
()])
validators
=
[
DataRequired
()])
check_encoding
=
BooleanField
(
'
Check encoding
'
)
check_encoding
=
BooleanField
(
'
Check encoding
'
)
...
@@ -54,15 +52,14 @@ class AddOCRJobForm(FlaskForm):
...
@@ -54,15 +52,14 @@ class AddOCRJobForm(FlaskForm):
split
=
BooleanField
(
'
Split
'
)
split
=
BooleanField
(
'
Split
'
)
submit
=
SubmitField
()
submit
=
SubmitField
()
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
version
=
SelectField
(
'
Version
'
,
version
=
SelectField
(
'
Version
'
,
choices
=
[(
'
latest
'
,
'
Latest
'
)],
choices
=
[(
'
latest
'
,
'
Latest
'
)],
validators
=
[
DataRequired
()])
validators
=
[
DataRequired
()])
def
validate_files
(
form
,
field
):
def
validate_files
(
form
,
field
):
for
file
in
field
.
data
:
for
file
in
field
.
data
:
if
not
file
.
filename
.
lower
().
endswith
(
(
'
.pdf
'
,
'
.tif
'
,
'
.tiff
'
)
):
if
not
file
.
filename
.
lower
().
endswith
(
'
.pdf
'
):
raise
ValidationError
(
'
File does not have an approved
'
raise
ValidationError
(
'
File does not have an approved
'
'
extension: .pdf
| .tif | .tiff
'
)
'
extension: .pdf
'
)
class
AddSetupFilesJobForm
(
FlaskForm
):
class
AddSetupFilesJobForm
(
FlaskForm
):
...
@@ -71,8 +68,7 @@ class AddSetupFilesJobForm(FlaskForm):
...
@@ -71,8 +68,7 @@ class AddSetupFilesJobForm(FlaskForm):
submit
=
SubmitField
()
submit
=
SubmitField
()
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
title
=
StringField
(
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)])
files
=
MultipleFileField
(
'
Files
'
,
validators
=
[
DataRequired
()])
files
=
MultipleFileField
(
'
Files
'
,
validators
=
[
DataRequired
()])
version
=
SelectField
(
'
Version
'
,
version
=
SelectField
(
'
Version
'
,
choices
=
[(
'
latest
'
,
'
Latest
'
)],
choices
=
[(
'
latest
'
,
'
Latest
'
)],
validators
=
[
DataRequired
()])
validators
=
[
DataRequired
()])
def
validate_files
(
form
,
field
):
def
validate_files
(
form
,
field
):
...
...
This diff is collapsed.
Click to expand it.
app/services/views.py
+
2
−
2
View file @
9da08508
...
@@ -41,8 +41,8 @@ def service(service):
...
@@ -41,8 +41,8 @@ def service(service):
service_args
.
append
(
'
--check-encoding
'
)
service_args
.
append
(
'
--check-encoding
'
)
if
service
==
'
ocr
'
:
if
service
==
'
ocr
'
:
service_args
.
append
(
'
-l {}
'
.
format
(
add_job_form
.
language
.
data
))
service_args
.
append
(
'
-l {}
'
.
format
(
add_job_form
.
language
.
data
))
if
not
add_job_form
.
binarization
.
data
:
if
add_job_form
.
binarization
.
data
:
service_args
.
append
(
'
--
skip-
binari
sation
'
)
service_args
.
append
(
'
--binari
ze
'
)
job
=
Job
(
creator
=
current_user
,
job
=
Job
(
creator
=
current_user
,
description
=
add_job_form
.
description
.
data
,
description
=
add_job_form
.
description
.
data
,
mem_mb
=
SERVICES
[
service
][
'
resources
'
][
'
mem_mb
'
],
mem_mb
=
SERVICES
[
service
][
'
resources
'
][
'
mem_mb
'
],
...
...
This diff is collapsed.
Click to expand it.
app/templates/services/ocr.html.j2
+
1
−
1
View file @
9da08508
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<div class="file-field input-field">
<div class="file-field input-field">
<div class="btn">
<div class="btn">
<span>{{ add_job_form.files.label.text }}</span>
<span>{{ add_job_form.files.label.text }}</span>
{{ add_job_form.files(accept='application/pdf
, image/tiff
') }}
{{ add_job_form.files(accept='application/pdf') }}
</div>
</div>
<div class="file-path-wrapper">
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
<input class="file-path validate" type="text">
...
...
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