Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICDAR2003 dataset integration #653

Merged
merged 26 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e7122a5
start synth
felixdittrich92 Nov 13, 2021
4fa0aff
cleanup
felixdittrich92 Nov 15, 2021
3ffdcc5
Merge branch 'mindee:main' into main
felixdittrich92 Nov 15, 2021
b74f06a
start synth
felixdittrich92 Nov 15, 2021
1a661e0
add synthtext
felixdittrich92 Nov 15, 2021
6270c93
add docu and tests
felixdittrich92 Nov 15, 2021
d74f148
apply code factor suggestions
felixdittrich92 Nov 15, 2021
9099e95
apply changes
felixdittrich92 Nov 15, 2021
23eca0d
Merge branch 'mindee:main' into main
felixdittrich92 Nov 15, 2021
7ba31e1
clean
felixdittrich92 Nov 15, 2021
02a8104
Merge branch 'mindee:main' into main
felixdittrich92 Nov 15, 2021
6955110
Merge branch 'mindee:main' into main
felixdittrich92 Nov 16, 2021
8fbeb30
Merge branch 'mindee:main' into main
felixdittrich92 Nov 16, 2021
7408935
Merge branch 'mindee:main' into main
felixdittrich92 Nov 17, 2021
a2b0fbc
Merge branch 'mindee:main' into main
felixdittrich92 Nov 19, 2021
a9cbd14
Merge branch 'mindee:main' into main
felixdittrich92 Nov 20, 2021
b245443
Merge branch 'mindee:main' into main
felixdittrich92 Nov 23, 2021
0cb2f7b
Merge branch 'mindee:main' into main
felixdittrich92 Nov 23, 2021
743c54a
Merge branch 'mindee:main' into main
felixdittrich92 Nov 25, 2021
1c1cbcb
Merge branch 'mindee:main' into main
felixdittrich92 Nov 25, 2021
cfbd898
Merge branch 'mindee:main' into main
felixdittrich92 Nov 30, 2021
2c764c2
start icdar2003
felixdittrich92 Nov 26, 2021
8ffe184
to relative
felixdittrich92 Nov 26, 2021
67128f9
up
felixdittrich92 Nov 26, 2021
2cee810
skip empty and to relative coords
felixdittrich92 Nov 29, 2021
247ef92
apply changes
felixdittrich92 Nov 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip empty and to relative coords
  • Loading branch information
felixdittrich92 committed Nov 30, 2021
commit 2cee8100d155541608a2ba5bb3cc7e49e1be2138
16 changes: 12 additions & 4 deletions doctr/datasets/icdar2003.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ def __init__(
for rect in rectangles
]

# Get the labels
labels = [lab.text for rect in rectangles for lab in rect if lab.text]

self.data.append((name.text, dict(boxes=np.asarray(_boxes, dtype=np_dtype), labels=labels)))
# filter images without boxes
if _boxes:
felixdittrich92 marked this conversation as resolved.
Show resolved Hide resolved
# Convert them to relative
w, h = int(resolution.attrib['x']), int(resolution.attrib['y'])
boxes = np.asarray(_boxes, dtype=np_dtype)
boxes[:, [0, 2]] /= w
boxes[:, [1, 3]] /= h

# Get the labels
labels = [lab.text for rect in rectangles for lab in rect if lab.text]

self.data.append((name.text, dict(boxes=boxes, labels=labels)))

self.root = tmp_root

Expand Down
2 changes: 1 addition & 1 deletion tests/pytorch/test_datasets_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_visiondataset():
['SVT', False, [512, 512], 249, False],
['SynthText', True, [512, 512], 27, True], # Actual set has 772875 samples
['SynthText', False, [512, 512], 3, False], # Actual set has 85875 samples
['ICDAR2003', True, [512, 512], 250, True],
['ICDAR2003', True, [512, 512], 246, True],
['ICDAR2003', False, [512, 512], 249, False],
],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/tensorflow/test_datasets_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
['SVT', False, [512, 512], 249, False],
['SynthText', True, [512, 512], 27, True], # Actual set has 772875 samples
['SynthText', False, [512, 512], 3, False], # Actual set has 85875 samples
['ICDAR2003', True, [512, 512], 250, True],
['ICDAR2003', True, [512, 512], 246, True],
['ICDAR2003', False, [512, 512], 249, False],
],
)
Expand Down