diff --git a/app/services/forms.py b/app/services/forms.py index 5c0af906..9d7edf80 100644 --- a/app/services/forms.py +++ b/app/services/forms.py @@ -3,6 +3,7 @@ from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileRequired from wtforms import ( BooleanField, + IntegerRangeField, MultipleFileField, SelectField, StringField, @@ -49,6 +50,9 @@ class CreateTesseractOCRPipelineJobForm(CreateJobBaseForm): binarization = BooleanField('Binarization') pdf = FileField('File', validators=[FileRequired()]) 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): service_info = SERVICES['tesseract-ocr-pipeline']['versions'][self.version.data] diff --git a/app/services/routes.py b/app/services/routes.py index b34d0619..7fe7a0eb 100644 --- a/app/services/routes.py +++ b/app/services/routes.py @@ -78,7 +78,8 @@ def tesseract_ocr_pipeline(): service=service_name, service_args={ '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, user=current_user diff --git a/app/templates/services/tesseract_ocr_pipeline.html.j2 b/app/templates/services/tesseract_ocr_pipeline.html.j2 index 982265bc..31bf155c 100644 --- a/app/templates/services/tesseract_ocr_pipeline.html.j2 +++ b/app/templates/services/tesseract_ocr_pipeline.html.j2 @@ -83,6 +83,11 @@ +

 

+
+

Intensity

+

{{ form.ocropus_nlbin_threshold() }}

+