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
!269
Update labels.json parsing during training
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update labels.json parsing during training
label-parsing
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Manon Blanco
requested to merge
label-parsing
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#186 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
7209ccea
1 commit,
1 year ago
1 file
+
1
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
dan/ocr/manager/dataset.py
+
1
−
5
Options
@@ -95,15 +95,11 @@ class OCRDataset(Dataset):
set_name
=
path_and_set
[
"
set_name
"
]
gt
=
gt_per_set
[
set_name
]
for
filename
in
natural_sort
(
gt
):
if
isinstance
(
gt
[
filename
],
dict
)
and
"
text
"
in
gt
[
filename
]:
label
=
gt
[
filename
][
"
text
"
]
else
:
label
=
gt
[
filename
]
filepath
=
Path
(
filename
)
samples
.
append
(
{
"
name
"
:
filepath
.
name
,
"
label
"
:
label
,
"
label
"
:
gt
[
filename
]
,
"
path
"
:
filepath
.
resolve
(),
}
)
Loading