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
6158f1c7
Commit
6158f1c7
authored
1 year ago
by
Yoann Schneider
Committed by
Manon Blanco
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix parsing of labels.json when generating stats
parent
5c37875f
No related branches found
No related tags found
1 merge request
!260
Fix parsing of labels.json when generating stats
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dan/datasets/analyze/statistics.py
+1
-3
1 addition, 3 deletions
dan/datasets/analyze/statistics.py
tests/data/training/training_dataset/labels.json
+6
-18
6 additions, 18 deletions
tests/data/training/training_dataset/labels.json
with
7 additions
and
21 deletions
dan/datasets/analyze/statistics.py
+
1
−
3
View file @
6158f1c7
# -*- coding: utf-8 -*-
from
collections
import
Counter
,
defaultdict
from
operator
import
itemgetter
from
pathlib
import
Path
from
typing
import
Dict
,
List
,
Optional
...
...
@@ -156,8 +155,7 @@ class Statistics:
# Path to the images are the key of the dict
self
.
create_image_statistics
(
images
=
split_data
.
keys
())
# The text is actually under the "text" key of the values
labels
=
list
(
map
(
itemgetter
(
"
text
"
),
split_data
.
values
()))
labels
=
list
(
split_data
.
values
())
# Text statistics
self
.
create_label_statistics
(
labels
=
labels
)
...
...
This diff is collapsed.
Click to expand it.
tests/data/training/training_dataset/labels.json
+
6
−
18
View file @
6158f1c7
{
"train"
:
{
"tests/data/training/training_dataset/images/0a34e13a-4ab0-4a91-8d7c-b1d8fee32628.png"
:
{
"text"
:
"The latter do not regard"
},
"tests/data/training/training_dataset/images/0a70e14f-feda-4607-989c-36cf581ddff5.png"
:
{
"text"
:
"At the beginning of"
}
"tests/data/training/training_dataset/images/0a34e13a-4ab0-4a91-8d7c-b1d8fee32628.png"
:
"The latter do not regard"
,
"tests/data/training/training_dataset/images/0a70e14f-feda-4607-989c-36cf581ddff5.png"
:
"At the beginning of"
},
"val"
:
{
"tests/data/training/training_dataset/images/0a576062-303c-4893-a729-c09c92865d31.png"
:
{
"text"
:
"One can remember with"
},
"tests/data/training/training_dataset/images/0b2457c8-81f1-4600-84d9-f8bf2822a991.png"
:
{
"text"
:
"The play was no more"
}
"tests/data/training/training_dataset/images/0a576062-303c-4893-a729-c09c92865d31.png"
:
"One can remember with"
,
"tests/data/training/training_dataset/images/0b2457c8-81f1-4600-84d9-f8bf2822a991.png"
:
"The play was no more"
},
"test"
:
{
"tests/data/training/training_dataset/images/fb3edb59-3678-49f8-8e16-8e32e3b0f051.png"
:
{
"text"
:
"Both her wrists bore"
},
"tests/data/training/training_dataset/images/fe498de2-ece4-4fbe-8b53-edfce1b820f0.png"
:
{
"text"
:
"SOME years ago a contemporary"
}
"tests/data/training/training_dataset/images/fb3edb59-3678-49f8-8e16-8e32e3b0f051.png"
:
"Both her wrists bore"
,
"tests/data/training/training_dataset/images/fe498de2-ece4-4fbe-8b53-edfce1b820f0.png"
:
"SOME years ago a contemporary"
}
}
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