TedEval: A Fair Evaluation Metric for Scene Text Detectors

Overview

TedEval: A Fair Evaluation Metric for Scene Text Detectors

Official Python 3 implementation of TedEval | paper | slides

Chae Young Lee, Youngmin Baek, and Hwalsuk Lee.

Clova AI Research, NAVER Corp.

Overview

We propose a new evaluation metric for scene text detectors called TedEval. Through separate instance-level matching policy and character-level scoring policy, TedEval solves the drawbacks of previous metrics such as IoU and DetEval. This code is based on ICDAR15 official evaluation code.

Methodology

1. Mathcing Policy

  • Non-exclusively gathers all possible matches of not only one-to-one but also one-to-many and many-to-one.
  • The threshold of both area recall and area precision are set to 0.4.
  • Multiline is identified and rejected when |min(theta, 180 - theta)| > 45 from Fig. 2.

2. Scoring Policy

We compute Pseudo Character Center (PCC) from word-level bounding boxes and penalize matches when PCCs are missing or overlapping.

Sample Evaluation

Experiments

We evaluated state-of-the-art scene text detectors with TedEval on two benchmark datasets: ICDAR 2013 Focused Scene Text (IC13) and ICDAR 2015 Incidental Scene Text (IC15). Detectors are listed in the order of published dates.

ICDAR 2013

Detector Date (YY/MM/DD) Recall (%) Precision (%) H-mean (%)
CTPN 16/09/12 82.1 92.7 87.6
RRPN 17/03/03 89.0 94.2 91.6
SegLink 17/03/19 65.6 74.9 70.0
EAST 17/04/11 77.7 87.1 82.5
WordSup 17/08/22 87.5 92.2 90.2
PixelLink 18/01/04 84.0 87.2 86.1
FOTS 18/01/05 91.5 93.0 92.6
TextBoxes++ 18/01/09 87.4 92.3 90.0
MaskTextSpotter 18/07/06 90.2 95.4 92.9
PMTD 19/03/28 94.0 95.2 94.7
CRAFT 19/04/03 93.6 96.5 95.1

ICDAR 2015

Detector Date (YY/MM/DD) Recall (%) Precision (%) H-mean (%)
CTPN 16/09/12 85.0 81.1 67.8
RRPN 17/03/03 79.5 85.9 82.6
SegLink 17/03/19 77.1 83.9 80.6
EAST 17/04/11 82.5 90.0 86.3
WordSup 17/08/22 83.2 87.1 85.2
PixelLink 18/01/04 85.7 86.1 86.0
FOTS 18/01/05 89.0 93.4 91.2
TextBoxes++ 18/01/09 82.4 90.8 86.5
MaskTextSpotter 18/07/06 82.5 91.8 86.9
PMTD 19/03/28 89.2 92.8 91.0
CRAFT 19/04/03 88.5 93.1 90.9

Frequency

Getting Started

Clone repository

git clone https://github.com/clovaai/TedEval.git

Requirements

  • python 3
  • python 3.x Polygon, Bottle, Pillow
# install
pip3 install Polygon3 bottle Pillow

Supported Annotation Type

  • LTRB(xmin, ymin, xmax, ymax)
  • QUAD(x1, y1, x2, y2, x3, y3, x4, y4)

Evaluation

Prepare data

The ground truth and the result data should be text files, one for each sample. Note that the naming rule of each text file is that there must be img_{number} in the filename and that the number indicate the image sample.

# gt/gt_img_38.txt
644,101,932,113,932,168,643,156,concierge@L3
477,138,487,139,488,149,477,148,###
344,131,398,130,398,149,344,149,###
1195,148,1277,138,1277,177,1194,187,###
23,270,128,267,128,282,23,284,###

# result/res_img_38.txt
644,101,932,113,932,168,643,156,{Transcription},{Confidence}
477,138,487,139,488,149,477,148
344,131,398,130,398,149,344,149
1195,148,1277,138,1277,177,1194,187
23,270,128,267,128,282,23,284

Compress these text files.

zip gt.zip gt/*
zip result.zip result/*

Refer to gt/result.zip and gt/gt_*.zip for examples.

Run stand-alone evaluation

python script.pyg=gt/gt.zips=result/result.zip
  • Locate the path of GT and submission file using the flag -g and -s, respectively.
  • QUAD annotation type is used as default. To switch between {QUAD, LTRB}, add -p='{"LTRB" = False}' in the command or directly modify the default_evaluation_params() function in script.py.
  • If there are transcription or confidence values in your submission file, add -p='{"CONFIDENCES" = True} or -p='{"TRANSCRIPTION" = True}'.

Run Visualizer

python web.py
  • Place the zip file of images and GTs of the dataset named images.zip and gt.zip, respectively, in the gt directory.
  • Create an empty directory name output. This is where the DB, submission files, and result files will be created.
  • You can change the host and port number in the final line of web.py.

The file structure should then be:

.
├── gt
│   ├── gt.zip
│   └── images.zip
├── output   # empty dir
├── script.py
├── web.py
├── README.md
└── ...

Citation

@article{lee2019tedeval,
  title={TedEval: A Fair Evaluation Metric for Scene Text Detectors},
  author={Lee, Chae Young and Baek, Youngmin and Lee, Hwalsuk},
  journal={arXiv preprint arXiv:1907.01227},
  year={2019}
}

Contact us

We welcome any feedbacks to our metric. Please contact the authors via {cylee7133, youngmin.baek, hwalsuk.lee}@gmail.com. In case of code errors, open an issue and we will get to you.

License

Copyright (c) 2019-present NAVER Corp.

 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Comments
  • Running EAST Argman results through TedEval

    Running EAST Argman results through TedEval

    Hi There,

    Thanks for your work on this improved evaluation metrics for text detection. I'm trying out some basic models like EAST on some synthetic data and evaluate it. Looks like EAST out of the box creates QUAD format results i.e. x1,y1,x2,y2,x3,y3,x4,y4 and IC13 ground truth text files are in LTRB format i.e. left,top,right,bottom,"transcription" (zip files from your gt folder).

    Can I still use the script.py to give one format for ground truth and another for submission files. ?

    I tried changing LTRB=True by default so it reads ground truth correctly but throws an error in my submission files saying format was incorrect and gave index out of range error. I know this is because I have 8 points. Where else do I need to make the changes so, it treats my submission file with 8 points(QUAD), keeping ground truth as LTRB?

    Also, open to any other suggestions, like if there is a way to convert my QUAD to LTRB to match with ground truth format.

    Appreciate any help !

    Mohammed Ayub

    opened by mohammedayub44 3
  • Ymax value not valid (Ymax < Ymin)

    Ymax value not valid (Ymax < Ymin)

    When I try to test IC15 ground truths with Pixellink boxes I always get this error:

    Traceback (most recent call last):
      File "script.py", line 555, in <module>
        rrc_evaluation_funcs.main_evaluation(None,default_evaluation_params,validate_data,evaluate_method)
      File "/home/hoangminhq/TestFolder/OCR/TedEval/rrc_evaluation_funcs.py", line 304, in main_evaluation
        evalData = evaluate_method_fn(p['g'], p['s'], evalParams)
      File "script.py", line 309, in evaluate_method
        pointsList,_,transcriptionsList = rrc_evaluation_funcs.get_tl_line_values_from_file_contents(gtFile,evaluationParams['CRLF'],evaluationParams['LTRB'],True,False)
      File "/home/hoangminhq/TestFolder/OCR/TedEval/rrc_evaluation_funcs.py", line 269, in get_tl_line_values_from_file_contents
        points, confidence, transcription = get_tl_line_values(line,LTRB,withTranscription,withConfidence,imWidth,imHeight);
      File "/home/hoangminhq/TestFolder/OCR/TedEval/rrc_evaluation_funcs.py", line 167, in get_tl_line_values
        raise Exception("Ymax value not valid (Ymax: %s < Ymin: %s)." %(ymax,ymin))  
    Exception: Ymax value not valid (Ymax: 351 < Ymin: 356).
    

    The zip files are here: gt.zip result.zip

    Even when I set -g and -s to be the same file I encountered the same error.

    opened by hoangminhq5310 2
  • can't eval

    can't eval

    this is the terminal response,i don't know what happened, my data format is xmin,ymin,xmax,ymax,transcription

    python script.py –g=gt/gt.zip –s=result/result.zip Traceback (most recent call last): File "script.py", line 555, in rrc_evaluation_funcs.main_evaluation(None,default_evaluation_params,validate_data,evaluate_method) File "/home/aikaka/TedEval/rrc_evaluation_funcs.py", line 304, in main_evaluation evalData = evaluate_method_fn(p['g'], p['s'], evalParams) File "script.py", line 347, in evaluate_method pointsList,confidencesList,_ = rrc_evaluation_funcs.get_tl_line_values_from_file_contents(detFile,evaluationParams['CRLF'],evaluationParams['LTRB'],evaluationParams['TRANSCRIPTION'],evaluationParams['CONFIDENCES']) File "/home/aikaka/TedEval/rrc_evaluation_funcs.py", line 269, in get_tl_line_values_from_file_contents points, confidence, transcription = get_tl_line_values(line,LTRB,withTranscription,withConfidence,imWidth,imHeight); File "/home/aikaka/TedEval/rrc_evaluation_funcs.py", line 158, in get_tl_line_values raise Exception("Format incorrect. Should be: xmin,ymin,xmax,ymax") Exception: Format incorrect. Should be: xmin,ymin,xmax,ymax

    help wanted 
    opened by qing3 2
  • match = detNum == list(filter(lambda p: p['det'] == 10, pairs))[0]['det']  IndexError: list index out of range

    match = detNum == list(filter(lambda p: p['det'] == 10, pairs))[0]['det'] IndexError: list index out of range

    I modified evaluation params CONFIDENCES=True and TRANSCRIPTION = True, input text file format like this:

    70,566,85,566,85,573,70,573,0.7102742,my_word
    

    the running issue is :

    File "/projects/TedEval-master/script.py", line 489, in evaluate_method
        match = detNum == list(filter(lambda p: p['det'] == 10, pairs))[0]['det']
    IndexError: list index out of range
    

    why p['det'] == 10? and the filter list result is None. How to slove this problem?

    opened by haoran1062 1
  • Mismatch PCC formulation in paper and code

    Mismatch PCC formulation in paper and code

    Hi there,

    As specified in the paper, the PCC of each character can be calculated by: image

    But in the code, line 162 of script.py, the calculation is different from the equation shown above. Shouldn't it be x = p1[0] + unitx * i - unitx/2?

    Also, what's the main purpose of subtraction of unitx/2, is it for regularization?

    Thanks.

    opened by chunchet-ng 1
Owner
Clova AI Research
Open source repository of Clova AI Research, NAVER & LINE
Clova AI Research
An Implementation of the alogrithm in paper IncepText: A New Inception-Text Module with Deformable PSROI Pooling for Multi-Oriented Scene Text Detection

InceptText-Tensorflow An Implementation of the alogrithm in paper IncepText: A New Inception-Text Module with Deformable PSROI Pooling for Multi-Orien

GeorgeJoe 115 Dec 12, 2022
huoyijie 1.2k Dec 29, 2022
OCR, Scene-Text-Understanding, Text Recognition

Scene-Text-Understanding Survey [2015-PAMI] Text Detection and Recognition in Imagery: A Survey paper [2014-Front.Comput.Sci] Scene Text Detection and

Alan Tang 354 Dec 12, 2022
MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition

MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition Python 2.7 Python 3.6 MORAN is a network with rectification mechanism for

Canjie Luo 595 Dec 27, 2022
Scene text recognition

AttentionOCR for Arbitrary-Shaped Scene Text Recognition Introduction This is the ranked No.1 tensorflow based scene text spotting algorithm on ICDAR2

null 777 Jan 9, 2023
Repository for Scene Text Detection with Supervised Pyramid Context Network with tensorflow.

Scene-Text-Detection-with-SPCNET Unofficial repository for [Scene Text Detection with Supervised Pyramid Context Network][https://arxiv.org/abs/1811.0

null 121 Oct 15, 2021
End-to-end pipeline for real-time scene text detection and recognition.

Real-time-Scene-Text-Detection-and-Recognition-System End-to-end pipeline for real-time scene text detection and recognition. The detection model use

Fangneng Zhan 89 Aug 4, 2022
RRD: Rotation-Sensitive Regression for Oriented Scene Text Detection

RRD: Rotation-Sensitive Regression for Oriented Scene Text Detection For more details, please refer to our paper. Citing Please cite the related works

Minghui Liao 102 Jun 29, 2022
caffe re-implementation of R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection

R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection Abstract This is a caffe re-implementation of R2CNN: Rotational Region CNN fo

candler 80 Dec 28, 2021
Source code of RRPN ---- Arbitrary-Oriented Scene Text Detection via Rotation Proposals

Paper source Arbitrary-Oriented Scene Text Detection via Rotation Proposals https://arxiv.org/abs/1703.01086 News We update RRPN in pytorch 1.0! View

null 428 Nov 22, 2022
This project modify tensorflow object detection api code to predict oriented bounding boxes. It can be used for scene text detection.

This is an oriented object detector based on tensorflow object detection API. Most of the code is not changed except for those related to the need of

Dafang He 30 Oct 22, 2022
A novel region proposal network for more general object detection ( including scene text detection ).

DeRPN: Taking a further step toward more general object detection DeRPN is a novel region proposal network which concentrates on improving the adaptiv

Deep Learning and Vision Computing Lab, SCUT 151 Dec 12, 2022
Code for the AAAI 2018 publication "SEE: Towards Semi-Supervised End-to-End Scene Text Recognition"

SEE: Towards Semi-Supervised End-to-End Scene Text Recognition Code for the AAAI 2018 publication "SEE: Towards Semi-Supervised End-to-End Scene Text

Christian Bartz 572 Jan 5, 2023
Scene text detection and recognition based on Extremal Region(ER)

Scene text recognition A real-time scene text recognition algorithm. Our system is able to recognize text in unconstrain background. This algorithm is

HSIEH, YI CHIA 155 Dec 6, 2022
Multi-Oriented Scene Text Detection via Corner Localization and Region Segmentation

This is the official implementation of "Multi-Oriented Scene Text Detection via Corner Localization and Region Segmentation". For more details, please

Pengyuan Lyu 309 Dec 6, 2022
Implementation of our paper 'PixelLink: Detecting Scene Text via Instance Segmentation' in AAAI2018

Code for the AAAI18 paper PixelLink: Detecting Scene Text via Instance Segmentation, by Dan Deng, Haifeng Liu, Xuelong Li, and Deng Cai. Contributions

null 758 Dec 22, 2022
TextField: Learning A Deep Direction Field for Irregular Scene Text Detection (TIP 2019)

TextField: Learning A Deep Direction Field for Irregular Scene Text Detection Introduction The code and trained models of: TextField: Learning A Deep

Yukang Wang 101 Dec 12, 2022
Implementation of EAST scene text detector in Keras

EAST: An Efficient and Accurate Scene Text Detector This is a Keras implementation of EAST based on a Tensorflow implementation made by argman. The or

Jan Zdenek 208 Nov 15, 2022
This is a pytorch re-implementation of EAST: An Efficient and Accurate Scene Text Detector.

EAST: An Efficient and Accurate Scene Text Detector Description: This version will be updated soon, please pay attention to this work. The motivation

Dejia Song 544 Dec 20, 2022