Skip to content

Commit 8ebaf8a

Browse files
committed
update readme and script
1 parent 002611e commit 8ebaf8a

File tree

18 files changed

+79
-73
lines changed

18 files changed

+79
-73
lines changed

davarocr/davarocr/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .davar_rcg import *
1414
from .davar_spotting import *
1515
from .davar_ie import *
16+
from .davar_videotext import *
1617
from .mmcv import *
1718
from .version import __version__
1819

davarocr/davarocr/davar_rcg/models/recognizors/general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def __init__(self,
5858
sequence_head (dict): sequence_head parameter
5959
neck (dict): neck parameter
6060
transformation (dict): transformation parameter
61-
train_cfg (dict): model training cfg parameter
62-
test_cfg (dict): model test cfg parameter
61+
train_cfg (mmcv.config): model training cfg parameter
62+
test_cfg (mmcv.config): model test cfg parameter
6363
pretrained (str): model path of the pre_trained model
6464
"""
6565
super(GeneralRecognizor, self).__init__()

davarocr/davarocr/davar_rcg/models/recognizors/rf_learning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def __init__(self,
4343
neck_s2v (dict): recognition to visual feature strengthened neck parameter
4444
transformation (dict): transformation parameter
4545
sequence_module (dict): sequence_module parameter
46-
train_cfg (dict): model training cfg parameter
47-
test_cfg (dict): model test cfg parameter
46+
train_cfg (mmcv.config): model training cfg parameter
47+
test_cfg (mmcv.config): model test cfg parameter
4848
pretrained (str): model path of the pre_trained model
4949
train_type (str): training type:
5050
1、"visual" - training visual counting branch

davarocr/tools/train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
from davarocr.davar_spotting.models.builder import build_spotter
3838

39+
from davarocr.davar_ner.models.builder import build_ner
40+
3941

4042
def parse_args():
4143
parser = argparse.ArgumentParser(description='Train a detector.')
@@ -217,6 +219,8 @@ def main():
217219
cfg.model,
218220
train_cfg=cfg.get('train_cfg', None),
219221
test_cfg=cfg.get('test_cfg', None))
222+
elif model_type == "NER":
223+
model = build_ner(cfg.model,train_cfg=cfg.get('train_cfg', None),test_cfg=cfg.get('test_cfg', None))
220224
else:
221225
raise NotImplementedError
222226

demo/text_detection/east/readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ The formatted training datalist and test datalist can be found in `demo/text_det
1111
Modified the paths ("imgs"/ "pretrained_model"/ "work_space", etc.) in the config files `demo/text_detection/east/config/east_r50_rbox.py`.
1212

1313
Run the following bash command in the command line,
14-
```shell
15-
cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/east/
16-
bash dist_train.sh
14+
``` bash
15+
>>> cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/east/
16+
>>> bash dist_train.sh
1717
```
1818

1919
> We provide the implementation of online validation. If you want to close it to save training time, you may modify the startup script to add `--no-validate` command.
2020
2121
## Offline Inference and Evaluation
2222
We provide a demo of forward inference and visualization. You can modify the paths (`test_dataset`, `image_prefix`, etc.) in the testing script, and start testing:
23-
```shell
24-
python test.py
23+
``` bash
24+
>>> python test.py
2525
```
2626
Some visualization of detection results are shown:
2727

demo/text_detection/evaluation/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
## Evaluation toolThis evaluation tools is from the repository of [SCUT-CTW1500](https://github.com/Yuliang-Liu/TIoU-metric/tree/master/curved-tiou). The code is slightly modified to be compatibled with python3.We provide some of the popular benchmarks, including [ICDAR2013](https://rrc.cvc.uab.es/?ch=2), [ICDAR2015](https://rrc.cvc.uab.es/?ch=4), [Total-Text](https://github.com/cs-chan/Total-Text-Dataset) and [SCUT-CTW1500](https://github.com/Yuliang-Liu/Curve-Text-Detector), and all of the ground-truthes are transformed into the requried format.The default evaluation metric sets IoU constraint as 0.5.#### Do evaluationDirectly run```shell python script.py -g=gt/total-text-gt.zip -s=pred/pred_tp_det_r50_tt_e25-45b1f5cf.zip``` will produce num_gt, num_det: 2214 2366 Origin: recall: 0.8234 precision: 0.8632 hmean: 0.8428Go into the directory of each algorithm for detailed evaluation results.
1+
## Evaluation toolThis evaluation tools is from the repository of [SCUT-CTW1500](https://github.com/Yuliang-Liu/TIoU-metric/tree/master/curved-tiou). The code is slightly modified to be compatibled with python3.We provide some of the popular benchmarks, including [ICDAR2013](https://rrc.cvc.uab.es/?ch=2), [ICDAR2015](https://rrc.cvc.uab.es/?ch=4), [Total-Text](https://github.com/cs-chan/Total-Text-Dataset) and [SCUT-CTW1500](https://github.com/Yuliang-Liu/Curve-Text-Detector), and all of the ground-truthes are transformed into the requried format.The default evaluation metric sets IoU constraint as 0.5.#### Do evaluationDirectly run python script.py -g=gt/total-text-gt.zip -s=pred/pred_tp_det_r50_tt_e25-45b1f5cf.zip will produce num_gt, num_det: 2214 2366 Origin: recall: 0.8234 precision: 0.8632 hmean: 0.8428Go into the directory of each algorithm for detailed evaluation results.

demo/text_detection/mask_rcnn_det/readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ The formatted training datalist and test datalist can be found in `demo/text_det
1111
Modified the paths ("imgs"/ "pretrained_model"/ "work_space", etc.) in the config files `demo/text_detection/mask_rcnn_det/config/mask_rcnn_r50_fpn.py`.
1212

1313
Run the following bash command in the command line,
14-
```shell
15-
cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/mask_rcnn_det/
16-
bash dist_train.sh
14+
``` bash
15+
>>> cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/mask_rcnn_det/
16+
>>> bash dist_train.sh
1717
```
1818

1919
> We provide the implementation of online validation. If you want to close it to save training time, you may modify the startup script to add `--no-validate` command.
2020
2121
## Offline Inference and Evaluation
2222
We provide a demo of forward inference and visualization. You can modify the paths (`test_dataset`, `image_prefix`, etc.) in the testing script, and start testing:
23-
```shell
24-
python test.py
23+
``` bash
24+
>>> python test.py
2525
```
2626
Some visualization of detection results are shown:
2727

demo/text_detection/text_perceptron_det/readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ The formatted training datalist and test datalist can be found in `demo/text_det
1414
Modified the paths of "imgs"/ "pretrained_model"/ "work_space" in the config files `demo/text_detection/text_perceptron_det/config/tp_r50_3stages_enlarge.py`.
1515

1616
Run the following bash command in the command line,
17-
```shell
18-
cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/text_perceptron_det/
19-
bash dist_train.sh
17+
``` bash
18+
>>> cd $DAVAR_LAB_OCR_ROOT$/demo/text_detection/text_perceptron_det/
19+
>>> bash dist_train.sh
2020
```
2121

2222
> We provide the implementation of online validation. If you want to close it to save training time, you may modify the startup script to add `--no-validate` command.
2323
2424
## Offline Inference and Evaluation
2525
We provide a demo of forward inference and visualization. You can modify the paths (`test_dataset`, `image_prefix`, etc.) in the testing script, and start testing:
26-
```shell
27-
python test.py
26+
``` bash
27+
>>> python test.py
2828
```
2929
Some visualization of detection results are shown:
3030

demo/text_recognition/__base__/res32_bilstm_attn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
type="DavarRCGDataset",
244244
data_type="LMDB_Standard",
245245
ann_file='mixture',
246-
img_prefix='/dataset/chengzhanzhan/TextRecognition/LMDB/BenchEn/validation/',
246+
img_prefix='/path/to/validation/',
247247
batch_max_length=25,
248248
used_ratio=1,
249249
test_mode=True,
@@ -257,7 +257,7 @@
257257
type="DavarRCGDataset",
258258
data_type='LMDB_Standard',
259259
ann_file='IIIT5k_3000',
260-
img_prefix='/dataset/chengzhanzhan/TextRecognition/LMDB/BenchEn/evaluation/',
260+
img_prefix='/path/to/evaluation/',
261261
batch_max_length=25,
262262
used_ratio=1,
263263
test_mode=True,
@@ -410,7 +410,7 @@
410410
log_level = 'INFO'
411411

412412
# The path where the model is saved
413-
work_dir = '/data1/workdir/davar_opensource/att_base/'
413+
work_dir = '//path/to/davar_opensource/att_base/'
414414

415415
# Load from Pre-trained model path
416416
load_from = None

demo/text_recognition/__base__/res32_bilstm_ctc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
type="DavarRCGDataset",
240240
data_type="LMDB_Standard",
241241
ann_file='mixture',
242-
img_prefix='/dataset/chengzhanzhan/TextRecognition/LMDB/BenchEn/validation/',
242+
img_prefix='/path/to/validation',
243243
batch_max_length=25,
244244
used_ratio=1,
245245
test_mode=True,
@@ -249,7 +249,7 @@
249249
type=dataset_type,
250250
data_type='LMDB_Standard',
251251
ann_file='IIIT5k_3000',
252-
img_prefix='/dataset/chengzhanzhan/TextRecognition/LMDB/BenchEn/evaluation/',
252+
img_prefix='/path/to/evaluation/',
253253
batch_ratios=1,
254254
batch_max_length=25,
255255
used_ratio=1,
@@ -402,7 +402,7 @@
402402
log_level = 'INFO'
403403

404404
# The path where the model is saved
405-
work_dir = '/data1/workdir/davar_opensource/ctc_base/'
405+
work_dir = '/path/to/davar_opensource/ctc_base/'
406406

407407
# Load from Pre-trained model path
408408
load_from = None

0 commit comments

Comments
 (0)