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
Merge requests
!128
Remove raw_line_seg_label, paragraphs_label, pages_label
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove raw_line_seg_label, paragraphs_label, pages_label
remove-raw-line-seg-label-paragraphs-label-pages-label
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Thibault Lavigne
requested to merge
remove-raw-line-seg-label-paragraphs-label-pages-label
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#51 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
b5a7d21a
1 commit,
1 year ago
1 file
+
0
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
dan/manager/dataset.py
+
0
−
16
Options
@@ -272,13 +272,6 @@ class GenericDataset(Dataset):
)
if
load_in_memory
:
samples
[
-
1
][
"
img
"
]
=
GenericDataset
.
load_image
(
filename
)
if
type
(
gt
[
filename
])
is
dict
:
if
"
lines
"
in
gt
[
filename
].
keys
():
samples
[
-
1
][
"
raw_line_seg_label
"
]
=
gt
[
filename
][
"
lines
"
]
if
"
paragraphs
"
in
gt
[
filename
].
keys
():
samples
[
-
1
][
"
paragraphs_label
"
]
=
gt
[
filename
][
"
paragraphs
"
]
if
"
pages
"
in
gt
[
filename
].
keys
():
samples
[
-
1
][
"
pages_label
"
]
=
gt
[
filename
][
"
pages
"
]
return
samples
def
apply_preprocessing
(
self
,
preprocessings
):
@@ -421,15 +414,6 @@ def apply_preprocessing(sample, preprocessings):
temp_img
=
np
.
expand_dims
(
temp_img
,
axis
=
2
)
img
=
temp_img
resize_ratio
=
[
ratio
,
ratio
]
if
resize_ratio
!=
[
1
,
1
]
and
"
raw_line_seg_label
"
in
sample
:
for
li
in
range
(
len
(
sample
[
"
raw_line_seg_label
"
])):
for
side
,
ratio
in
zip
(
([
"
bottom
"
,
"
top
"
],
[
"
right
"
,
"
left
"
]),
resize_ratio
):
for
s
in
side
:
sample
[
"
raw_line_seg_label
"
][
li
][
s
]
=
(
sample
[
"
raw_line_seg_label
"
][
li
][
s
]
*
ratio
)
sample
[
"
img
"
]
=
img
sample
[
"
resize_ratio
"
]
=
resize_ratio
Loading