Skip to content

Commit

Permalink
add repr
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Nov 15, 2021
1 parent 9099e95 commit 09d0d83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doctr/datasets/synthtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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}"

0 comments on commit 09d0d83

Please sign in to comment.