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

[FIX] Error in unpacking archive of CORD dataset #1190

Merged
merged 2 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions doctr/datasets/cord.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ class CORD(VisionDataset):
TRAIN = (
"https://doctr-static.mindee.com/models?id=v0.1.1/cord_train.zip&src=0",
"45f9dc77f126490f3e52d7cb4f70ef3c57e649ea86d19d862a2757c9c455d7f8",
"cord_train.zip",
)

TEST = (
"https://doctr-static.mindee.com/models?id=v0.1.1/cord_test.zip&src=0",
"8c895e3d6f7e1161c5b7245e3723ce15c04d84be89eaa6093949b75a66fb3c58",
"cord_test.zip",
)

def __init__(
Expand All @@ -52,10 +54,10 @@ def __init__(
recognition_task: bool = False,
**kwargs: Any,
) -> None:
url, sha256 = self.TRAIN if train else self.TEST
url, sha256, name = self.TRAIN if train else self.TEST
super().__init__(
url,
None,
name,
sha256,
True,
pre_transforms=convert_target_to_relative if not recognition_task else None,
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 @@ -414,7 +414,7 @@ def test_funsd(input_size, num_samples, rotate, recognition, mock_funsd_dataset)
)
def test_cord(input_size, num_samples, rotate, recognition, mock_cord_dataset):
# monkeypatch the path to temporary dataset
datasets.CORD.TRAIN = (mock_cord_dataset, None)
datasets.CORD.TRAIN = (mock_cord_dataset, None, "cord_train.zip")

ds = datasets.CORD(
train=True,
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 @@ -388,7 +388,7 @@ def test_funsd(input_size, num_samples, rotate, recognition, mock_funsd_dataset)
)
def test_cord(input_size, num_samples, rotate, recognition, mock_cord_dataset):
# monkeypatch the path to temporary dataset
datasets.CORD.TRAIN = (mock_cord_dataset, None)
datasets.CORD.TRAIN = (mock_cord_dataset, None, "cord_train.zip")

ds = datasets.CORD(
train=True,
Expand Down