From d514784878b16ee6af0824da1bfb067b3ed7838a Mon Sep 17 00:00:00 2001 From: Xinyu Wang <45810070+xinke-wang@users.noreply.github.com> Date: Tue, 15 Nov 2022 19:42:43 +0800 Subject: [PATCH] [Feature] Add SVTP to dataset preparer (#1523) * add svtp * fix comments --- dataset_zoo/svtp/metafile.yml | 26 ++++++++++++++++++++++++++ dataset_zoo/svtp/sample_anno.md | 7 +++++++ dataset_zoo/svtp/textrecog.py | 27 +++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 dataset_zoo/svtp/metafile.yml create mode 100644 dataset_zoo/svtp/sample_anno.md create mode 100644 dataset_zoo/svtp/textrecog.py diff --git a/dataset_zoo/svtp/metafile.yml b/dataset_zoo/svtp/metafile.yml new file mode 100644 index 00000000..a544d35d --- /dev/null +++ b/dataset_zoo/svtp/metafile.yml @@ -0,0 +1,26 @@ +Name: 'Street View Text Perspective (SVT-P)' +Paper: + Title: Recognizing Text with Perspective Distortion in Natural Scenes + URL: https://openaccess.thecvf.com/content_iccv_2013/papers/Phan_Recognizing_Text_with_2013_ICCV_paper.pdf + Venue: ICCV + Year: '2013' + BibTeX: '@inproceedings{phan2013recognizing, + title={Recognizing text with perspective distortion in natural scenes}, + author={Phan, Trung Quy and Shivakumara, Palaiahnakote and Tian, Shangxuan and Tan, Chew Lim}, + booktitle={Proceedings of the IEEE International Conference on Computer Vision}, + pages={569--576}, + year={2013}}' +Data: + Website: http://www.comp.nus.edu.sg/~phanquyt/ + Language: + - English + Scene: + - Natural Scene + Granularity: + - Word + Tasks: + - textrecog + License: + Type: N/A + Link: N/A + Format: .txt diff --git a/dataset_zoo/svtp/sample_anno.md b/dataset_zoo/svtp/sample_anno.md new file mode 100644 index 00000000..11711e25 --- /dev/null +++ b/dataset_zoo/svtp/sample_anno.md @@ -0,0 +1,7 @@ +**Text Recognition** + +```txt +13_15_0_par.jpg WYNDHAM +13_15_1_par.jpg HOTEL +12_16_0_par.jpg UNITED +``` diff --git a/dataset_zoo/svtp/textrecog.py b/dataset_zoo/svtp/textrecog.py new file mode 100644 index 00000000..ca0cc0ae --- /dev/null +++ b/dataset_zoo/svtp/textrecog.py @@ -0,0 +1,27 @@ +data_root = 'data/svtp' +cache_path = 'data/cache' + +data_obtainer = dict( + type='NaiveDataObtainer', + cache_path=cache_path, + data_root=data_root, + files=[ + dict( + url='https://download.openmmlab.com/mmocr/data/svtp.zip', + save_name='svtp.zip', + md5='4232b46c81ba99eea6d057dcb06b8f75', + split=['test'], + content=['image', 'annotation'], + mapping=[['svtp/par1', 'textrecog_imgs/test'], + ['svtp/gt.txt', 'annotations/test.txt']]), + ]) + +data_converter = dict( + type='TextRecogDataConverter', + splits=['test'], + data_root=data_root, + gatherer=dict(type='mono_gather', mapping="f'{split}.txt'"), + parser=dict( + type='ICDARTxtTextRecogAnnParser', separator=' ', format='img text'), + dumper=dict(type='JsonDumper'), + delete=['svtp', 'annotations'])