Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Data Generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
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
Data Generator
Commits
a53f8f96
Commit
a53f8f96
authored
3 years ago
by
Martin Maarand
Browse files
Options
Downloads
Patches
Plain Diff
rename script to avoid clash with package name
parent
540884e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
rename script to avoid clash with package name
Pipeline
#74294
passed
3 years ago
Stage: test
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.isort.cfg
+1
-1
1 addition, 1 deletion
.isort.cfg
README.md
+11
-11
11 additions, 11 deletions
README.md
kaldi_data_generator/kaldi_data_generator.py
+0
-661
0 additions, 661 deletions
kaldi_data_generator/kaldi_data_generator.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
13 additions
and
674 deletions
.isort.cfg
+
1
−
1
View file @
a53f8f96
...
...
@@ -8,4 +8,4 @@ line_length = 88
default_section
=
FIRSTPARTY
known_first_party
=
known_third_party
=
PIL,
apistar,arkindex,
cv2,numpy,pytest,requests,setuptools
,tqdm
known_third_party
=
PIL,cv2,numpy,pytest,requests,setuptools
This diff is collapsed.
Click to expand it.
README.md
+
11
−
11
View file @
a53f8f96
...
...
@@ -9,33 +9,33 @@ and converts data to Kaldi format or kraken format. It also generates train, val
`ARKINDEX_API_TOKEN`
and
`ARKINDEX_API_URL`
environment variables must be defined.
Install
necessary dependencies
Install
it as a package
```
bash
virtualenv
-p
python3 .env
source
.env/bin/activate
pip
install
-
r
requirements.txt
pip
install
-
e
.
```
Use help to list possible parameters:
```
bash
python
kaldi
_
data
_
generator
.py
--help
kaldi
-
data
-
generator
--help
```
There is also an option that skips all vertical transcriptions and it is
`--skip_vertical_lines`
#### Kaldi format
Simple example:
```
bash
python
kaldi
_
data
_
generator
.py
-f
kaldi
--dataset_name
my_balsac
--out_dir
/tmp/balsac/
--volumes
8f4005e9-1921-47b0-be7b-e27c7fd29486 d2f7c563-1622-4721-bd51-96fab97189f7
kaldi
-
data
-
generator
-f
kaldi
--dataset_name
my_balsac
--out_dir
/tmp/balsac/
--volumes
8f4005e9-1921-47b0-be7b-e27c7fd29486 d2f7c563-1622-4721-bd51-96fab97189f7
```
With corpus ids
```
bash
python
kaldi
_
data
_
generator
.py
-f
kaldi
--dataset_name
cz
--out_dir
/tmp/home_cz/
--corpora
1ed45e94-9108-4029-a529-9abe37f55ba0
kaldi
-
data
-
generator
-f
kaldi
--dataset_name
cz
--out_dir
/tmp/home_cz/
--corpora
1ed45e94-9108-4029-a529-9abe37f55ba0
```
Polygon example:
```
bash
python
kaldi
_
data
_
generator
.py
-f
kaldi
--dataset_name
my_balsac2
--extraction_mode
polygon
--out_dir
/tmp/balsac/
--pages
50e1c3c0-2fe9-4216-805e-1a2fd2e7e9f4
kaldi
-
data
-
generator
-f
kaldi
--dataset_name
my_balsac2
--extraction_mode
polygon
--out_dir
/tmp/balsac/
--pages
50e1c3c0-2fe9-4216-805e-1a2fd2e7e9f4
```
The script creates 3 directories
`Lines`
,
`Transcriptions`
,
`Partitions`
in the specified
`out_dir`
.
...
...
@@ -45,13 +45,13 @@ The contents of these directories must be copied (or symlinked) to the correspon
simple examples:
```
$
python3
kaldi
_
data
_
generator
.py
-f kraken -o <output_dir> --volumes <volume_id> --no_split
$ kaldi
-
data
-
generator -f kraken -o <output_dir> --volumes <volume_id> --no_split
```
For instance to download the 4 sets from IAM (2 validation set on Arkindex) in 3 directories :
```
$
python3
kaldi
_
data
_
generator
.py
-f kraken -o iam_training --volumes e7a95479-e5fc-4b20-830c-0c6e38bf8f72 --no_split
$
python3
kaldi
_
data
_
generator
.py
-f kraken -o iam_validation --volumes edc78ee1-09e0-4671-806b-5fc0392707d9 --no_split
$
python3
kaldi
_
data
_
generator
.py
-f kraken -o iam_validation --volumes fefbbfca-a6dd-4e00-8797-0d4628cb024d --no_split
$
python3
kaldi
_
data
_
generator
.py
-f kraken -o iam_test --volumes 0ce2b631-01d7-49bf-b213-ceb6eae74a9b --no_split
$ kaldi
-
data
-
generator -f kraken -o iam_training --volumes e7a95479-e5fc-4b20-830c-0c6e38bf8f72 --no_split
$ kaldi
-
data
-
generator -f kraken -o iam_validation --volumes edc78ee1-09e0-4671-806b-5fc0392707d9 --no_split
$ kaldi
-
data
-
generator -f kraken -o iam_validation --volumes fefbbfca-a6dd-4e00-8797-0d4628cb024d --no_split
$ kaldi
-
data
-
generator -f kraken -o iam_test --volumes 0ce2b631-01d7-49bf-b213-ceb6eae74a9b --no_split
```
This diff is collapsed.
Click to expand it.
kaldi_data_generator/kaldi_data_generator.py
deleted
100644 → 0
+
0
−
661
View file @
540884e9
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
a53f8f96
...
...
@@ -22,6 +22,6 @@ setup(
author
=
"
Martin
"
,
author_email
=
"
maarand@teklia.com
"
,
install_requires
=
parse_requirements
(),
entry_points
=
{
"
console_scripts
"
:
[
f
"
{
COMMAND
}
=
{
MODULE
}
.
kaldi_data_generator
:main
"
]},
entry_points
=
{
"
console_scripts
"
:
[
f
"
{
COMMAND
}
=
{
MODULE
}
.
main
:main
"
]},
packages
=
find_packages
(),
)
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