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
92bcc25d
Commit
92bcc25d
authored
1 year ago
by
Nolan
Committed by
Yoann Schneider
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove nb_cols from dataset file
parent
a26125a5
No related branches found
No related tags found
1 merge request
!123
Remove nb_cols from dataset file
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dan/manager/dataset.py
+0
-3
0 additions, 3 deletions
dan/manager/dataset.py
dan/manager/ocr.py
+0
-4
0 additions, 4 deletions
dan/manager/ocr.py
dan/manager/utils.py
+0
-2
0 additions, 2 deletions
dan/manager/utils.py
with
0 additions
and
9 deletions
dan/manager/dataset.py
+
0
−
3
View file @
92bcc25d
...
...
@@ -268,9 +268,6 @@ class GenericDataset(Dataset):
"
label
"
:
label
,
"
unchanged_label
"
:
label
,
"
path
"
:
os
.
path
.
abspath
(
filename
),
"
nb_cols
"
:
1
if
"
nb_cols
"
not
in
gt
[
filename
]
else
gt
[
filename
][
"
nb_cols
"
],
}
)
if
load_in_memory
:
...
...
This diff is collapsed.
Click to expand it.
dan/manager/ocr.py
+
0
−
4
View file @
92bcc25d
...
...
@@ -445,7 +445,6 @@ class OCRDataset(GenericDataset):
sample
[
"
label_begin
"
]
=
pages
[
0
][
1
][
"
begin
"
]
sample
[
"
label_sem
"
]
=
pages
[
0
][
1
][
"
sem
"
]
sample
[
"
label
"
]
=
pages
[
0
][
1
]
sample
[
"
nb_cols
"
]
=
pages
[
0
][
2
]
else
:
if
pages
[
0
][
0
].
shape
[
0
]
!=
pages
[
1
][
0
].
shape
[
0
]:
max_height
=
max
(
pages
[
0
][
0
].
shape
[
0
],
pages
[
1
][
0
].
shape
[
0
])
...
...
@@ -459,7 +458,6 @@ class OCRDataset(GenericDataset):
sample
[
"
label_begin
"
]
=
pages
[
0
][
1
][
"
begin
"
]
+
pages
[
1
][
1
][
"
begin
"
]
sample
[
"
label_sem
"
]
=
pages
[
0
][
1
][
"
sem
"
]
+
pages
[
1
][
1
][
"
sem
"
]
sample
[
"
img
"
]
=
np
.
concatenate
([
pages
[
0
][
0
],
pages
[
1
][
0
]],
axis
=
1
)
sample
[
"
nb_cols
"
]
=
pages
[
0
][
2
]
+
pages
[
1
][
2
]
sample
[
"
label
"
]
=
sample
[
"
label_raw
"
]
if
"
ⓑ
"
in
self
.
charset
:
sample
[
"
label
"
]
=
sample
[
"
label_begin
"
]
...
...
@@ -587,7 +585,6 @@ class OCRCollateFunction:
batch_data
[
i
][
"
unchanged_label
"
]
for
i
in
range
(
len
(
batch_data
))
]
nb_cols
=
[
batch_data
[
i
][
"
nb_cols
"
]
for
i
in
range
(
len
(
batch_data
))]
nb_lines
=
[
batch_data
[
i
][
"
nb_lines
"
]
for
i
in
range
(
len
(
batch_data
))]
line_raw
=
[
batch_data
[
i
][
"
line_label
"
]
for
i
in
range
(
len
(
batch_data
))]
line_token
=
[
batch_data
[
i
][
"
token_line_label
"
]
for
i
in
range
(
len
(
batch_data
))]
...
...
@@ -652,7 +649,6 @@ class OCRCollateFunction:
"
names
"
:
names
,
"
ids
"
:
ids
,
"
nb_lines
"
:
nb_lines
,
"
nb_cols
"
:
nb_cols
,
"
labels
"
:
labels
,
"
reverse_labels
"
:
reverse_labels
,
"
raw_labels
"
:
raw_labels
,
...
...
This diff is collapsed.
Click to expand it.
dan/manager/utils.py
+
0
−
2
View file @
92bcc25d
...
...
@@ -54,7 +54,6 @@ class OCRManager(GenericTrainingManager):
{
"
path
"
:
sample
[
"
path
"
],
"
label
"
:
chunk
,
"
nb_cols
"
:
1
,
}
)
...
...
@@ -67,7 +66,6 @@ class OCRManager(GenericTrainingManager):
Image
.
fromarray
(
img
).
save
(
img_path
)
gt
[
set_name
][
img_name
]
=
{
"
text
"
:
sample
[
"
label
"
],
"
nb_cols
"
:
sample
[
"
nb_cols
"
]
if
"
nb_cols
"
in
sample
else
1
,
}
if
"
line_label
"
in
sample
:
gt
[
set_name
][
img_name
][
"
lines
"
]
=
sample
[
"
line_label
"
]
...
...
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