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
928f327e
Commit
928f327e
authored
1 year ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Extract the "train" set first
parent
fab96823
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!343
Extract the "train" set first
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dan/datasets/extract/arkindex.py
+4
-0
4 additions, 0 deletions
dan/datasets/extract/arkindex.py
tests/conftest.py
+4
-3
4 additions, 3 deletions
tests/conftest.py
with
8 additions
and
3 deletions
dan/datasets/extract/arkindex.py
+
4
−
0
View file @
928f327e
...
...
@@ -282,6 +282,10 @@ class ArkindexExtractor:
)
continue
# Extract the train set first to correctly build the `self.charset` variable
splits
.
remove
(
TRAIN_NAME
)
splits
.
insert
(
0
,
TRAIN_NAME
)
# Iterate over the subsets to find the page images and labels.
for
split
in
splits
:
with
tqdm
(
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
4
−
3
View file @
928f327e
...
...
@@ -21,7 +21,7 @@ from arkindex_export import (
WorkerVersion
,
database
,
)
from
dan.datasets.extract.arkindex
import
SPLI
T_NAME
S
from
dan.datasets.extract.arkindex
import
TES
T_NAME
,
TRAIN_NAME
,
VAL_NAME
from
tests
import
FIXTURES
...
...
@@ -181,15 +181,16 @@ def mock_database(tmp_path_factory):
)
# Create dataset
split_names
=
[
VAL_NAME
,
TEST_NAME
,
TRAIN_NAME
]
dataset
=
Dataset
.
create
(
id
=
"
dataset_id
"
,
name
=
"
Dataset
"
,
state
=
"
complete
"
,
sets
=
"
,
"
.
join
(
SPLIT_NAMES
),
sets
=
"
,
"
.
join
(
split_names
),
)
# Create dataset elements
for
split
in
SPLIT_NAMES
:
for
split
in
split_names
:
element_path
=
(
FIXTURES
/
"
extraction
"
/
"
elements
"
/
split
).
with_suffix
(
"
.json
"
)
...
...
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