mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Add switch for binarization
This commit is contained in:
parent
6cf12fa799
commit
c51a9492f3
@ -1,5 +1,6 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import MultipleFileField, SelectField, StringField, SubmitField, ValidationError
|
||||
from wtforms import (BooleanField, MultipleFileField, SelectField, StringField,
|
||||
SubmitField, ValidationError)
|
||||
from wtforms.validators import DataRequired, Length
|
||||
|
||||
|
||||
@ -34,6 +35,7 @@ class NewNLPJobForm(FlaskForm):
|
||||
|
||||
|
||||
class NewOCRJobForm(FlaskForm):
|
||||
binarization = BooleanField('Binarazation')
|
||||
description = StringField('Description',
|
||||
validators=[DataRequired(), Length(1, 255)])
|
||||
files = MultipleFileField('Files', validators=[DataRequired()])
|
||||
@ -49,6 +51,7 @@ class NewOCRJobForm(FlaskForm):
|
||||
('por', 'Portuguese'),
|
||||
('spa', 'Spanish; Castilian')],
|
||||
validators=[DataRequired()])
|
||||
split = BooleanField('Split')
|
||||
submit = SubmitField('Submit')
|
||||
title = StringField('Title', validators=[DataRequired(), Length(1, 32)])
|
||||
version = SelectField('Version',
|
||||
|
@ -62,9 +62,13 @@ def ocr():
|
||||
mem_mb=8192,
|
||||
n_cores=4,
|
||||
service='ocr',
|
||||
service_args=json.dumps([
|
||||
service_args=json.dumps(
|
||||
[
|
||||
'-l {}'.format(new_ocr_job_form.language.data),
|
||||
'--skip-binarisation']),
|
||||
'' if new_ocr_job_form.binarization.data
|
||||
else '--skip-binarisation'
|
||||
]
|
||||
),
|
||||
service_version=new_ocr_job_form.version.data,
|
||||
status='preparing',
|
||||
title=new_ocr_job_form.title.data)
|
||||
|
@ -88,8 +88,7 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s12"></div>
|
||||
<div class="col s12 m6">
|
||||
<div class="file-field input-field">
|
||||
<div class="btn">
|
||||
@ -114,6 +113,23 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col s12"></div>
|
||||
<div class="col s12">
|
||||
<div class="switch right-align">
|
||||
<label>
|
||||
Perform binarization
|
||||
{{ new_ocr_job_form.binarization() }}
|
||||
<span class="lever"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="switch right-align">
|
||||
<label>
|
||||
Split pages in half
|
||||
<input type="checkbox" disabled>
|
||||
<span class="lever"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action right-align">
|
||||
|
Loading…
Reference in New Issue
Block a user