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

CodeCamp #116 Add SROIE to dataset preparer #1639

Merged
Prev Previous commit
Next Next commit
Update mmocr/datasets/preparers/data_converpyter.
Co-authored-by: Tong Gao <[email protected]>
  • Loading branch information
FerryHuang and gaotongxiao authored Dec 25, 2022
commit 1f7920a714094f53e0211ecd8c61cdf2af5761ff
9 changes: 4 additions & 5 deletions mmocr/datasets/preparers/data_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ def pair_gather(self, img_path: str, suffixes: List, rule: Sequence,
for file in list_files(img_path, suffixes):
if not re.match(rule[0], osp.basename(file)):
continue
else:
file2 = re.sub(rule[0], rule[1], osp.basename(file))
file2 = file.replace(osp.basename(file), file2)
file2 = file2.replace(self.img_dir, 'annotations')
files.append((file, file2))
file2 = re.sub(rule[0], rule[1], osp.basename(file))
file2 = file.replace(osp.basename(file), file2)
file2 = file2.replace(self.img_dir, 'annotations')
files.append((file, file2))

return files

Expand Down