Skip to content
ModelListedExternal
Download

Persian Cdistnet Ocr

The official code of CDistNet.

KindOtherVersionRevision c6ad26f

Model source

Kind
Other
File size
93.5 MB
Version
vRevision c6ad26f
Updated
Sep 26, 2026
Downloads
0
Tasks
Captioning
Source
Hugging Face

Source description

CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition

The official code of CDistNet.

Paper Link : Arxiv Link

What's News

  • [2023-08]๐ŸŒŸ Our paper is accepted by IJCV
  • [2022-01]๐ŸŒŸ Our code is released in github
  • [2021-11]๐ŸŒŸ The paper can be read in Arixv: http://arxiv.org/abs/2111.11011

pipline

To Do List

  • HA-IC13 & CA-IC13
  • Pre-train model
  • Cleaned Code
  • Document
  • Distributed Training

Two New Datasets

we test other sota method in HA-IC13 and CA-IC13 datasets.

HA_CA CDistNet has a performance advantage over other SOTA methods as the character distance increases (1-6)

HA-IC13

Method123456Code & Pretrain model
VisionLAN (ICCV 2021)93.5892.8889.9782.2672.2361.03Offical Code
ABINet (CVPR 2021 )95.9295.2291.9585.7673.7564.99Offical Code
RobustScanner* (ECCV 2020)96.1595.3393.2388.9181.1071.53--
Transformer-baseline*96.2795.4592.4286.4679.3572.46--
CDistNet96.6296.1594.2889.9683.4377.71--

CA-IC13

Method123456Code & Pretrain model
VisionLAN (ICCV 2021)94.8792.7784.0175.0364.2952.74Offical Code
ABINet (CVPR 2021 )96.6295.9287.8676.3165.4654.49Offical Code
RobustScanner* (ECCV 2020)95.2294.8785.3076.5568.3860.79--
Transformer-baseline*95.6894.4085.8875.8565.9358.58--
CDistNet96.2795.5788.4579.5870.3663.13--

Datasets

The datasets are same as ABINet

  • Training datasets

    1. MJSynth (MJ):
    2. SynthText (ST):
  • Evaluation & Test datasets, LMDB datasets can be downloaded from BaiduNetdisk(passwd:1dbv), GoogleDrive.

    1. ICDAR 2013 (IC13)
    2. ICDAR 2015 (IC15)
    3. IIIT5K Words (IIIT)
    4. Street View Text (SVT)
    5. Street View Text-Perspective (SVTP)
    6. CUTE80 (CUTE)
  • Augment IC13

  • The structure of dataset directory is

    dataset
    โ”œโ”€โ”€ eval
    โ”‚   โ”œโ”€โ”€ CUTE80
    โ”‚   โ”œโ”€โ”€ IC13_857
    โ”‚   โ”œโ”€โ”€ IC15_1811
    โ”‚   โ”œโ”€โ”€ IIIT5k_3000
    โ”‚   โ”œโ”€โ”€ SVT
    โ”‚   โ””โ”€โ”€ SVTP
    โ”œโ”€โ”€ train
    โ”‚   โ”œโ”€โ”€ MJ
    โ”‚   โ”‚   โ”œโ”€โ”€ MJ_test
    โ”‚   โ”‚   โ”œโ”€โ”€ MJ_train
    โ”‚   โ”‚   โ””โ”€โ”€ MJ_valid
    โ”‚   โ””โ”€โ”€ ST
    

Environment

package you can find in env_cdistnet.yaml.

#Installed
conda create -n CDistNet python=3.7
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=9.2 -c pytorch
pip install opencv-python mmcv notebook numpy einops tensorboardX Pillow thop timm tornado tqdm matplotlib lmdb

Pretrained Models

Get the pretrained models from BaiduNetdisk(passwd:d6jd), GoogleDrive. (We both offer training log and result.csv in same file.) The pretrained model should set in models/reconstruct_CDistNetv3_3_10

Performances of the pretrained models are summaried as follows:

comment: <> (|CDistNet(paper)|6|97.67|93.82|96.57|86.25|89.77|89.58|92.28|)

comment: <> (|CDistNet(rebuild)|4|97.43|93.51|96.37|86.03|88.68|93.4|92.57|)

Train

CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --config=configs/CDistNet_config.py

Eval

CUDA_VISIBLE_DEVICES=0 python eval.py --config=configs/CDistNet_config.py

Citation

@article{Zheng2021CDistNetPM,
  title={CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition},
  author={Tianlun Zheng and Zhineng Chen and Shancheng Fang and Hongtao Xie and Yu-Gang Jiang},
  journal={ArXiv},
  year={2021},
  volume={abs/2111.11011}
}

Sources

1 source
Hugging FacePrimaryVersion c6ad26f6331cda1029850c5a77f9faf2a1aae8b5
huggingface.co/mohammadsaleh40/persian-cdistnet-ocr/tree/c6ad26f6331cda1029850c5a77f9faf2a1aae8b5

Verified Sep 10

Model artifacts

1 artifact

models/all_tiny_13font_persian_cdistnet_128_36/epoch7_best_acc.pth

pth ยท 93.5 MB ยท SHA-256 9b3b4e0857f0โ€ฆbf19 ยท Hugging Face

Download

Source excerpts

2 excerpts

--- datasets: - mohammadsaleh40/persian-word-ocr language: - fa pipeline_tag: image-to-text --- # CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition The official code of CDistNet. Paper Link : [Arxiv Link](http://arxiv.org/abs/2111.11011) ## What's News - [2023-08]๐ŸŒŸ Our paper is accepted by IJCV - [2022-01]๐ŸŒŸ Our code is released in github - [2021-11]๐ŸŒŸ The paper can be read in Arixv: http://arxiv.org/abs/2111.11011 ![pipline](./utils/fig2_00.png) ## To Do List * [x] HA-IC13 & CA-IC13 * [x] Pre-train model * [x] Cleaned Code * [ ] Document * [ ] Distributed Training ## Two New Datasets we test other sota method in HA-IC13 and CA-IC13 datasets. ![HA_CA](./utils/fig5_00.png) **CDistNet has a performance advantage over other SOTA methods as the character distance increases (1-6)** ### HA-IC13 |Method |1 | 2 | 3 | 4 | 5 | 6 | Code & Pretrain model| |- | - | - | - | - | - | - | - | |VisionLAN (ICCV 2021) | 93.58 | 92.88 | 89.97 | 82.26 | 72.23 | 61.03 | [Offical Code](https://github.com/wangyuxin87/VisionLAN)| |ABINet (CVPR 2021 ) | 95.92 |95.22 | 91.95 | 85.76 | 73.75 | 64.99 | [Offical Code](https://github.com/FangShancheng/ABINet)| |RobustScanner* (ECCV 2020) | 96.15 | 95.33 | 93.23 | 88.91 | 81.10 |71.53 | -- | | Transformer-baseline* | 96.27 | 95.45 | 92.42 | 86.46 | 79.35 | 72.46 | -- | |CDistNet |**96.62**| **96.15** | **94.28** | **89.96** | **83.43** | **77.71** | -- | ### CA-IC13 |Method |1 | 2 | 3 | 4 | 5 | 6 | Code & Pretrain model| |- | - | - | - | - | - | - | - | |VisionLAN (ICCV 2021) | 94.87 | 92.77 | 84.01 | 75.03 | 64.29 | 52.74 | [Offical Code](https://github.com/wangyuxin87/VisionLAN)| |ABINet (CVPR 2021 ) | **96.62** | **95.92** | 87.86 |76.31 | 65.46 | 54.49 | [Offical Code](https://github.com/FangShancheng/ABINet)| |RobustScanner* (ECCV 2020) | 95.22 | 94.87 | 85.30 | 76.55 | 68.38 |60.79 | -- | | Transformer-baseline* | 95.68 | 94.40 | 85.88 | 75.85 | 65.93 | 58.58 | -- | |CDistNet | 96.27 | 95.57 | **88.45** | **79.58** | **70.36** | **63.13** | -- | ## Datasets **The datasets are same as ABINet** - Training datasets 1. [MJSynth](http://www.robots.ox.ac.uk/~vgg/data/text/) (MJ): - [LMDB dataset BaiduNetdisk(passwd:n23k)](https://pan.baidu.com/s/1mgnTiyoR8f6Cm655rFI4HQ) 2. [SynthText](http://www.robots.ox.ac.uk/~vgg/data/scenetext/) (ST): - [LMDB dataset BaiduNetdisk(passwd:n23k)](https://pa...

Source context: 0 downloads ยท 0 likes ยท Pipeline image-to-text ยท Repo mohammadsaleh40/persian-cdistnet-ocr