Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
b7305617
Commit
b7305617
authored
1 year ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Remove add_eot and add_sot parameters from training configuration
parent
c8bd6c91
No related branches found
No related tags found
1 merge request
!161
Remove add_eot and add_sot parameters from training configuration
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dan/manager/ocr.py
+2
-4
2 additions, 4 deletions
dan/manager/ocr.py
dan/ocr/document/train.py
+1
-4
1 addition, 4 deletions
dan/ocr/document/train.py
tests/conftest.py
+1
-4
1 addition, 4 deletions
tests/conftest.py
with
4 additions
and
12 deletions
dan/manager/ocr.py
+
2
−
4
View file @
b7305617
...
...
@@ -174,11 +174,9 @@ class OCRDataset(GenericDataset):
sample
[
"
label
"
]
=
full_label
sample
[
"
token_label
"
]
=
token_to_ind
(
self
.
charset
,
full_label
)
if
"
add_eot
"
in
self
.
params
[
"
config
"
][
"
constraints
"
]:
sample
[
"
token_label
"
].
append
(
self
.
tokens
[
"
end
"
])
sample
[
"
token_label
"
].
append
(
self
.
tokens
[
"
end
"
])
sample
[
"
label_len
"
]
=
len
(
sample
[
"
token_label
"
])
if
"
add_sot
"
in
self
.
params
[
"
config
"
][
"
constraints
"
]:
sample
[
"
token_label
"
].
insert
(
0
,
self
.
tokens
[
"
start
"
])
sample
[
"
token_label
"
].
insert
(
0
,
self
.
tokens
[
"
start
"
])
return
sample
...
...
This diff is collapsed.
Click to expand it.
dan/ocr/document/train.py
+
1
−
4
View file @
b7305617
...
...
@@ -109,10 +109,7 @@ def get_config():
"
height_divisor
"
:
32
,
# Image height will be divided by 32
"
padding_value
"
:
0
,
# Image padding value
"
padding_token
"
:
None
,
# Label padding value
"
constraints
"
:
[
"
add_eot
"
,
"
add_sot
"
,
],
# add end-of-transcription and start-of-transcription tokens in labels
"
constraints
"
:
[],
"
preprocessings
"
:
[
{
"
type
"
:
"
to_RGB
"
,
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
1
−
4
View file @
b7305617
...
...
@@ -72,10 +72,7 @@ def training_config():
"
height_divisor
"
:
32
,
# Image height will be divided by 32
"
padding_value
"
:
0
,
# Image padding value
"
padding_token
"
:
None
,
# Label padding value
"
constraints
"
:
[
"
add_eot
"
,
"
add_sot
"
,
],
# add end-of-transcription and start-of-transcription tokens in labels
"
constraints
"
:
[],
"
preprocessings
"
:
[
{
"
type
"
:
"
to_RGB
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment