From 09d0d83dc7f6148b22db199eda37b353be7d54c6 Mon Sep 17 00:00:00 2001 From: felixdittrich92 Date: Mon, 15 Nov 2021 15:01:09 +0100 Subject: [PATCH] add repr --- doctr/datasets/synthtext.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doctr/datasets/synthtext.py b/doctr/datasets/synthtext.py index 51fbbad1e2..4bc1f0e9d8 100644 --- a/doctr/datasets/synthtext.py +++ b/doctr/datasets/synthtext.py @@ -45,6 +45,7 @@ def __init__( super().__init__(url=self.URL, file_name=None, file_hash=self.SHA256, extract_archive=True, **kwargs) self.sample_transforms = sample_transforms + self.train = train # Load mat data tmp_root = os.path.join(self.root, 'SynthText') @@ -77,9 +78,11 @@ def __init__( self.data.append((img_path[0], dict(boxes=np.asarray(box_targets, dtype=np_dtype), labels=labels))) - if train: + if self.train: self.data = self.data[:int(len(self.data) * 0.9)] else: self.data = self.data[int(len(self.data) * 0.9):] - self.root = tmp_root + + def extra_repr(self) -> str: + return f"train={self.train}"