Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
roatienza committed May 3, 2021
2 parents 035deda + 17cd0f6 commit 0eb22c2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ ViTSTR is a simple single-stage model that uses a pre-trained Vision Transformer

ViTSTR is built using a fork of [CLOVA AI Deep Text Recognition Benchmark](https://github.com/clovaai/deep-text-recognition-benchmark) whose original documentation is at the bottom. Below we document how to train and evaluate ViTSTR-Tiny and ViTSTR-small.

### Install requirements

```
pip3 install -r requirements.txt
```

### Dataset

Download lmdb dataset. See CLOVA AI original documentation below.

### Quick validation using a pre-trained model

```
CUDA_VISIBLE_DEVICES=0 python3 test.py --eval_data data_lmdb_release/evaluation
--benchmark_all_eval --Transformation None --FeatureExtraction None
--SequenceModeling None --Prediction None --Transformer
--TransformerModel=vitstr_tiny_patch16_224
--saved_model https://
--sensitive --data_filtering_off --imgH 224 --imgW 224
```

### Train ViTSTR-Tiny

No data augmentation
Expand All @@ -32,7 +53,7 @@ CUDA_VISIBLE_DEVICES=0 python3 train.py --train_data data_lmdb_release/training
--manualSeed=$RANDOM --sensitive --isrand_aug --workers=32
```

### ViTSTR-Small and Multi-GPU training
### ViTSTR-Small and multi-GPU training

Best to train larger networks like ViTSTR-Small and ViTSTR-Base on a multi-GPU machine. To keep a fixed batch size at `192`, use the `--batch_size` option. Divide `192` by the number of GPUs. For example, to train ViTSTR-Small on a 4-GPU machine, this would be `--batch_size=48`.

Expand Down

0 comments on commit 0eb22c2

Please sign in to comment.