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
d202ed1b
Commit
d202ed1b
authored
5 years ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
fix line_id bug
parent
6aee925c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kaldi_data_generator.py
+2
-2
2 additions, 2 deletions
kaldi_data_generator.py
with
2 additions
and
2 deletions
kaldi_data_generator.py
+
2
−
2
View file @
d202ed1b
...
...
@@ -94,10 +94,10 @@ class KaldiDataGenerator:
for
i
,
[
x
,
y
,
w
,
h
]
in
enumerate
(
line_bounding_rects
):
cropped
=
img
[
y
:
y
+
h
,
x
:
x
+
w
].
copy
()
cv2
.
imwrite
(
f
'
{
self
.
out_line_img_dir
}
_
{
i
}
.jpg
'
,
cropped
)
cv2
.
imwrite
(
f
'
{
self
.
out_line_img_dir
}
/
{
page_id
}
_
{
i
}
.jpg
'
,
cropped
)
for
i
,
text
in
enumerate
(
line_transcriptions
):
write_file
(
f
"
{
self
.
out_line_text_dir
}
_
{
i
}
.txt
"
,
text
)
write_file
(
f
"
{
self
.
out_line_text_dir
}
/
{
page_id
}
_
{
i
}
.txt
"
,
text
)
def
run_pages
(
self
,
page_ids
):
for
page_id
in
page_ids
:
...
...
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