mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Ocropus nlbin threshold extension
This commit is contained in:
parent
1faa98b4e8
commit
f4f0628b60
@ -3,6 +3,7 @@ from flask_wtf import FlaskForm
|
|||||||
from flask_wtf.file import FileField, FileRequired
|
from flask_wtf.file import FileField, FileRequired
|
||||||
from wtforms import (
|
from wtforms import (
|
||||||
BooleanField,
|
BooleanField,
|
||||||
|
IntegerRangeField,
|
||||||
MultipleFileField,
|
MultipleFileField,
|
||||||
SelectField,
|
SelectField,
|
||||||
StringField,
|
StringField,
|
||||||
@ -49,6 +50,9 @@ class CreateTesseractOCRPipelineJobForm(CreateJobBaseForm):
|
|||||||
binarization = BooleanField('Binarization')
|
binarization = BooleanField('Binarization')
|
||||||
pdf = FileField('File', validators=[FileRequired()])
|
pdf = FileField('File', validators=[FileRequired()])
|
||||||
model = SelectField('Model', validators=[InputRequired()])
|
model = SelectField('Model', validators=[InputRequired()])
|
||||||
|
ocropus_nlbin_threshold = IntegerRangeField(
|
||||||
|
render_kw={'tooltips':'false', 'min': 0, 'max': 1, 'step': 0.1, 'start': [0.5]}
|
||||||
|
)
|
||||||
|
|
||||||
def validate_binarization(self, field):
|
def validate_binarization(self, field):
|
||||||
service_info = SERVICES['tesseract-ocr-pipeline']['versions'][self.version.data]
|
service_info = SERVICES['tesseract-ocr-pipeline']['versions'][self.version.data]
|
||||||
|
@ -78,7 +78,8 @@ def tesseract_ocr_pipeline():
|
|||||||
service=service_name,
|
service=service_name,
|
||||||
service_args={
|
service_args={
|
||||||
'binarization': form.binarization.data,
|
'binarization': form.binarization.data,
|
||||||
'model': hashids.decode(form.model.data)
|
'model': hashids.decode(form.model.data),
|
||||||
|
'ocropus_nlbin_threshold': form.ocropus_nlbin_threshold.data
|
||||||
},
|
},
|
||||||
service_version=form.version.data,
|
service_version=form.version.data,
|
||||||
user=current_user
|
user=current_user
|
||||||
|
@ -84,6 +84,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col s12"><p> </p></div>
|
<div class="col s12"><p> </p></div>
|
||||||
|
<div class="col s9">
|
||||||
|
<p>Intensity</p>
|
||||||
|
<p class="range-field">{{ form.ocropus_nlbin_threshold() }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col s12"><p> </p></div>
|
||||||
<div class="col s12 divider"></div>
|
<div class="col s12 divider"></div>
|
||||||
<div class="col s12"><p> </p></div>
|
<div class="col s12"><p> </p></div>
|
||||||
<div class="col s9">
|
<div class="col s9">
|
||||||
|
Loading…
Reference in New Issue
Block a user