Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
scripta
eScriptorium
Commits
89fea6fa
Commit
89fea6fa
authored
Oct 06, 2020
by
Robin Tissot
Browse files
Adds empty label for default segmentation model in the modal.
parent
d9746462
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/apps/core/forms.py
View file @
89fea6fa
...
...
@@ -3,6 +3,7 @@ import logging
from
PIL
import
Image
from
django
import
forms
from
django.conf
import
settings
from
django.core.validators
import
FileExtensionValidator
,
MinValueValidator
,
MaxValueValidator
from
django.db.models
import
Q
from
django.forms.models
import
inlineformset_factory
...
...
@@ -146,9 +147,10 @@ class DocumentProcessForm(BootstrapFormMixin, forms.Form):
)
segmentation_steps
=
forms
.
ChoiceField
(
choices
=
SEGMENTATION_STEPS_CHOICES
,
initial
=
'both'
,
required
=
False
)
seg_model
=
forms
.
ModelChoiceField
(
queryset
=
OcrModel
.
objects
.
filter
(
job
=
OcrModel
.
MODEL_JOB_SEGMENT
),
label
=
_
(
"Model"
),
required
=
False
)
seg_model
=
forms
.
ModelChoiceField
(
queryset
=
OcrModel
.
objects
.
filter
(
job
=
OcrModel
.
MODEL_JOB_SEGMENT
),
label
=
_
(
"Model"
),
empty_label
=
"default ({name})"
.
format
(
name
=
settings
.
KRAKEN_DEFAULT_SEGMENTATION_MODEL
.
rsplit
(
'/'
)[
-
1
]),
required
=
False
)
override
=
forms
.
BooleanField
(
required
=
False
,
initial
=
True
,
help_text
=
_
(
"If checked, deletes existing segmentation <b>and bound transcriptions</b> first!"
))
TEXT_DIRECTION_CHOICES
=
((
'horizontal-lr'
,
_
(
"Horizontal l2r"
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment