mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +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 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
|
from wtforms.validators import DataRequired, Length
|
||||||
|
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ class NewNLPJobForm(FlaskForm):
|
|||||||
|
|
||||||
|
|
||||||
class NewOCRJobForm(FlaskForm):
|
class NewOCRJobForm(FlaskForm):
|
||||||
|
binarization = BooleanField('Binarazation')
|
||||||
description = StringField('Description',
|
description = StringField('Description',
|
||||||
validators=[DataRequired(), Length(1, 255)])
|
validators=[DataRequired(), Length(1, 255)])
|
||||||
files = MultipleFileField('Files', validators=[DataRequired()])
|
files = MultipleFileField('Files', validators=[DataRequired()])
|
||||||
@ -49,6 +51,7 @@ class NewOCRJobForm(FlaskForm):
|
|||||||
('por', 'Portuguese'),
|
('por', 'Portuguese'),
|
||||||
('spa', 'Spanish; Castilian')],
|
('spa', 'Spanish; Castilian')],
|
||||||
validators=[DataRequired()])
|
validators=[DataRequired()])
|
||||||
|
split = BooleanField('Split')
|
||||||
submit = SubmitField('Submit')
|
submit = SubmitField('Submit')
|
||||||
title = StringField('Title', validators=[DataRequired(), Length(1, 32)])
|
title = StringField('Title', validators=[DataRequired(), Length(1, 32)])
|
||||||
version = SelectField('Version',
|
version = SelectField('Version',
|
||||||
|
@ -62,9 +62,13 @@ def ocr():
|
|||||||
mem_mb=8192,
|
mem_mb=8192,
|
||||||
n_cores=4,
|
n_cores=4,
|
||||||
service='ocr',
|
service='ocr',
|
||||||
service_args=json.dumps([
|
service_args=json.dumps(
|
||||||
'-l {}'.format(new_ocr_job_form.language.data),
|
[
|
||||||
'--skip-binarisation']),
|
'-l {}'.format(new_ocr_job_form.language.data),
|
||||||
|
'' if new_ocr_job_form.binarization.data
|
||||||
|
else '--skip-binarisation'
|
||||||
|
]
|
||||||
|
),
|
||||||
service_version=new_ocr_job_form.version.data,
|
service_version=new_ocr_job_form.version.data,
|
||||||
status='preparing',
|
status='preparing',
|
||||||
title=new_ocr_job_form.title.data)
|
title=new_ocr_job_form.title.data)
|
||||||
|
@ -88,8 +88,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col s12"></div>
|
||||||
<div class="row">
|
|
||||||
<div class="col s12 m6">
|
<div class="col s12 m6">
|
||||||
<div class="file-field input-field">
|
<div class="file-field input-field">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
@ -114,6 +113,23 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
<div class="card-action right-align">
|
<div class="card-action right-align">
|
||||||
|
Loading…
Reference in New Issue
Block a user