Code Monkey home page Code Monkey logo

sar_tf's Introduction

Show, Attend and Read: A Simple and Strong Baseline for Irregular Text Recognition [AAAI-2019]

Introduction

This is an unofficial implementation of Show, Attend and Read: A Simple and Strong Baseline for Irregular Text Recognition
Official Torch implementation can be found here
Another PyTorch implementation can be found here

How to use

Install

pip3 install -r requirements.txt

Demo

  • Download the pretrained model from BaiduYun and unzip it.
  • Run
python3 test.py --test_data_dir ./demo_data --checkpoints ./sar_synall_lmdb_checkpoints_2epochs -g "0" --vis_dir ./visualize
  • Results will be printed and attention weights visualizing images can be found in directory './visualize'

Train

  • Data prepare
    LMDB format is suggested. refer here to generate data in LMDB format. Also raw images with annoation file (json or txt) is also supported. The stucture of annoation file please refer to txt or json
  • Run
    LMDB:
     python3 train.py --checkpoints /path/to/save/checkpoints --train_data_dir /path/to/your/train/LMDB/data/dir --test_data_dir /path/to/your/test/LMDB/data/dir  -g "0"
    
    Raw images:
     python3 train.py --checkpoints /path/to/save/checkpoints --train_data_dir /path/to/your/train/images/dir --train_data_gt /path/to/your/train/annotation/file(txt or json) --test_data_dir /path/to/your/test/images/dir --test_data_gt /path/to/your/train/annotation/file(txt or json) -g "0"
    
    More hyper-parameters please refer to config.py

Test

Similar to demo and you can also provide annotation and it will calculate accuracy

python3 test.py --test_data_dir /path/to/your/test/images/dir --test_data_gt /path/to/your/test/annotation/file(optional) --checkpoints /path/to/trained/checkpoints -g "0"

Reproduced results

IC13 IC15 SVTP CUTE
Official 91.0 69.2 76.4 83.3
This One 91.8 69.6 75.1 83.6

Examples

image_1 image_2

sar_tf's People

Contributors

pay20y avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.