Commit Graph

307 Commits (0aa5d7be6dadfc16e0f3a39f03c02446cf4c206f)

Author SHA1 Message Date
Tong Gao 7bbb14f0d1
[Fix] Replace SyncBN with BN for inference (#420)
* add revert_sync_batchnorm

* replace SyncBN in inference and test scripts

* add tests

* hide BatchNormXd
2021-08-10 22:19:17 +08:00
Jiaqi Duan f24be6c614
fix bug of dice loss: loss always 1 if empty target (#408) 2021-08-04 06:05:31 +00:00
Hongbin Sun 3707d67106
support batch inference for crnn and segocr (#407)
* support batch inference for crnn and segocr
2021-08-03 16:52:58 +08:00
Tong Gao 4f7270e574
Fix #282: Support init_cfg & update depreciated configs (#365)
* update coco ref

* init_cfg for dbnet

* initcfg for mask_rcnn

* textsnake init_cfg

* fix dbnet

* panet initcfg

* psenet initcfg

* fcenet initcfg

* drrg initcfg

* add init_cfg to detectors

* update maskrcnn config file to support mmdet

* fix init_cfg of fce_head

* crnn initcfg

* init_weights in training

* nrtr initcfg

* robust_scanner initcfg

* sar init_cfg

* seg init_cfg

* tps_crnn init_cfg

* sdmgr initcfg

* ner init_cfg

* fix textsnake

* sdmgr initcfg

* move "pretrained" to "init_cfg" for config files

* Moduleslist update

* fix seg

* ner init_cfg

* fix base

* fix encode decode recognizer

* revert dbnet config

* fix crnn

* fix base.py

* fix robust_scanner

* fix panet

* fix test

* remove redundant init_weights() in fcehead

* clean up

* relex mmdet version in workflow

* Add dependency version check

* Update mmocr/models/textdet/dense_heads/pse_head.py

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-07-20 23:18:25 +08:00
Hongbin Sun 44fed8590b
fix bug: remove tail whitespace from gt label (#358)
* fix bug: remove tail whitespace from gt label

* remove useless

* refactor
2021-07-09 13:24:34 +00:00
Hongbin Sun 20f65fb521
use unifor_concat_datase instead of concat_dataset (#343)
* use unifor_concat_datase instead of concat_dataset

* add unittest for uniform_concat_dataset
2021-07-03 16:03:37 +08:00
AllentDan 97ac619e68
[Fix] Fix unit tests, remove temporary files (#328)
* fix unit tests, remove temp files

* use tempfile package and fix typo

* all files clear
2021-06-26 22:51:50 +08:00
lizz 8999c56159
Fix kie_test_imgs script for novisual (#319)
* Fix kie_test_imgs script for novisual

Signed-off-by: lizz <lizz@sensetime.com>

* Fix test

Signed-off-by: lizz <lizz@sensetime.com>
2021-06-24 07:22:34 +00:00
Hongbin Sun 7c4eb7e056
fix #253: speedup; fix assert (#263)
* fix #253: speedup; fix assert

* fix #253: speedup; fix assert

* add unittest for bug fix block
2021-06-23 08:16:57 +00:00
Hongbin Sun 82f64a5b62
support batch inference during testing (#310)
* support batch inference during testing

* fix unittest

* update docs using url

* set cfg for train, val and test

* update docs

* update docs and test.py

* samples_per_gpu as global setting

* changes revert
2021-06-23 11:34:29 +08:00
GT 9582f93c70
Support ocr box stitching (#290)
* ocr box stitching

* rename a varible

* add a demo

* move functions to box_util
add test
2021-06-19 19:28:14 +08:00
AllentDan a86ab115e4
fix unit tests (#300) 2021-06-18 18:27:20 +08:00
AllentDan f1b003ddb1
[Feature] Add deployment evaluation (#291)
* add deployment evaluation

* fix lint

* remove cpu unit tests for trt and onnx

* use pytest.mark to skip cpu unit test

* move to mmocr/core

* emm... renamed to wrappers

* renamed to deploy_utils

* renamed unit test to test_deploy_utils

* fix lint

* using pytest.mark.importorskip
2021-06-18 12:27:10 +08:00
AllentDan d57f279083
[Fix] Correct isort setup (#288)
* isort

* remove tools from setup.cfg
2021-06-16 19:44:01 +08:00
Jianyong Chen 3bfbb2b619
fix #113: textsnake decode error (#264)
* fix #113: textsnake decode error

* fix unittest test cases
2021-06-15 08:09:05 +00:00
AllentDan 0131b3290f
[Feature] Add onnx and tensorrt export tool (#278)
* add onnx and tensorrt export

* fix lint

* delete batch input to avoid dbnet error

* resolve unittest

* fix lint

* export unittest
2021-06-15 07:51:36 +00:00
Zyq-scut 18e7ecc379
add fce ic15 (#258) 2021-06-03 15:00:38 +08:00
lizz 36e92ebe70
Speed up sort_vertex (#239)
* Speed up sort_vertex

Signed-off-by: lizz <lizz@sensetime.com>

* Fix test

Signed-off-by: lizz <lizz@sensetime.com>
2021-05-25 19:58:05 +08:00
lizz b10b6408ef
Add list_from_file and list_to_file (#226)
* Add list_from_file and list_to_file

Signed-off-by: lizz <lizz@sensetime.com>

* Add test list_to_file and list_from_file

* more

* Fix tests
2021-05-24 06:01:42 +00:00
Jianyong Chen 0bd32889d4
fix #212: improve drrg (#224) 2021-05-21 18:36:44 +08:00
Zyq-scut 8c60e4b4d1
update fcenet (#214)
* update fcenet

* fix typos

* fix
2021-05-18 21:52:34 +08:00
lizz 9e0595f70b
Test more on cpu (#217)
Signed-off-by: lizz <lizz@sensetime.com>
2021-05-18 21:47:32 +08:00
Hongbin Sun 673aadc355
Hbsun/feature iss205 (#210)
* fix #205: remove act2fn

* fix pytest
2021-05-18 15:15:35 +08:00
hq_wei 24c590bb04
Ner task (#148)
* update ner standard code format

* add pytest

* fix pre-commit

* Annotate the dataset section

* fix pre-commit for dataset

* rm big files and add comments in dataset

* rename configs for ner task

* minor changes if metric

* Note modification

* fix pre-commit

* detail modification

* rm transform

* rm magic number

* fix warnings in pylint

* fix pre-commit

* correct help info

* rename model files

* rename err fixed

* 428_tag

* Adjust to more general pipline

* update unit test rate

* update

* Unit test coverage over 90% and add Readme

* modify details

* fix precommit

* update

* fix pre-commit

* update

* update

* update

* update result

* update readme

* update baseline config

* update config and small minor changes

* minor changes in readme and etc.

* back to original

* update toy config

* upload model and log

* fix pytest

* Modify the notes.

* fix readme

* Delete Chinese punctuation

* add demo and fix some logic and naming problems

* add To_tensor transformer for ner and load pretrained model in config

* delete extra lines

* split ner loss to MaskedCrossEntropyLoss and MaskedFocalLoss

* update config

* fix err

* updata

* modify noqa

* update new model report

* fix err in ner demo

* Update ner_dataset.py

* Update test_ner_dataset.py

* Update ner_dataset.py

* Update ner_transforms.py

* rm toy config and data

* add comment

* add empty

* fix conflict

* fix precommit

* fix pytest

* fix pytest err

* Update ner_dataset.py

* change dataset name to cluener2020

* move the postprocess in metric to convertor

* rm __init__ etc.

* precommit

* add discription in loss

* add auto download

* add http

* update

* remove some 'issert'

* replace unsqueeze

* update config

* update doc and bert.py

* update

* update demo code

Co-authored-by: weihuaqiang <weihuaqiang@sensetime.com>
Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-05-18 11:33:51 +08:00
Jianyong Chen 2414c65577
Add drrg (#189)
* merge drrg

* directory structure&fix redundant import

* docstrings

* fix isort

* drrg readme

* merge drrg

* directory structure&fix redundant import

* docstrings

* fix isort

* drrg readme

* add unittests&fix docstrings

* revert test_loss

* add unittest

* add unittests

* fix docstrings

* fix docstrings

* fix yapf

* fix yapf

* Update test_textdet_head.py

* Update test_textdet_head.py

* add unittests

* add unittests

* add unittests

* fix docstrings

* fix docstrings

* fix docstring

* fix unittests

* fix pytest

* fix pytest

* fix pytest

* fix variable names

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-05-18 11:15:47 +08:00
Zyq-scut cbdd98a1e1
add fcenet (#133)
* add fcenet

* fix linting and code style

* fcenet finetune

* Update transforms.py

* Update fcenet_r50dcnv2_fpn_1500e_ctw1500.py

* Update fcenet_targets.py

* Update fce_loss.py

* fix

* add readme

* fix config

* Update fcenet_r50dcnv2_fpn_1500e_ctw1500.py

* fix

* fix readme

* fix readme

* Update test_loss.py

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-05-14 21:37:04 +08:00
Hongbin Sun 97e2f27017
fix #173: support aug test (#178)
* fix #173: support aug test

* fix pytest

* support batch inference for both text det and recog

* update unittest

* use one img for batch infer test
2021-05-13 07:18:00 +00:00
Hongbin Sun df5493a79e
refactor tps config (#135)
* refactor tps config

* recover tps

* add ckpt of tps
2021-05-12 06:14:24 +00:00
Sergio Bugallo Enjamio 18c54afbdc
Add support for batch inference (#86)
* Add support for numpy arrays in model_inference

* Add test for numpy ndarray inference

* Fix linting problems

* Add support for batch inference

* Add batch inference demo script

* Fix comment

* Test batch inference with paths and arrays

* lint code

* Update model_inference docstring

* Refactor model inference tests

* Change inference function to make text detectors and recognizers use the same input data types

* Change single state text detector model to support batch inference

* Lint code

* simplify inference tests

* Remove psenet from batch inference test cases to prevent the pytest being killed

* Update batch_image_demo.py

* fix bug when test with dataset 

fix bug when test with dataset, for example, `./tools/dist_test.sh configs/textrecog/sar/sar_r31_parallel_decoder_academic.py <checkpoint> 1 --eval acc`

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-05-12 02:04:01 +00:00
kang sheng e7f27ae317
change argument names according to convention (#131)
* change argument names according to convention

* bug fix when rename leakyRelu
2021-05-11 16:07:36 +08:00
jeffreykuang 47896a3f80
Unit tests of dbnet transform (#163)
* Add unit test for dbnet transforms

* Add unit test for dbnet transforms

* Add unit test for dbnet transforms
2021-05-11 15:21:14 +08:00
Hongbin Sun 892d486d01
add model for chinese (#156)
* add model for chinese

* update readme

* update readme

* fix link error; add vis for Chinese
2021-05-09 21:49:08 +08:00
lizz 5054a3f78d
Implement iter protocol for Loader (#150)
* Implement iter protocal for Loader

Signed-off-by: lizz <lizz@sensetime.com>

* Test iter protocal

Signed-off-by: lizz <lizz@sensetime.com>
2021-05-06 09:51:29 +00:00
lizz 47965516f0
Improve KIE (#153)
* Improve KIE
* allow data do not contain label
* Make relation float32

Signed-off-by: lizz <lizz@sensetime.com>

* Add test

Signed-off-by: lizz <lizz@sensetime.com>
2021-05-06 09:51:10 +00:00
Jianyong Chen e29b5b8abe
Fix issue 122 (#130)
* fix #122: textsnake targets adaptation

* fix #122: textsnake targets adaptation

* add unittest

* fix format

* fix textsnake unittest on cpu

* fix unit test coverage

* add unit test
2021-04-29 11:02:57 +08:00
LvTianlei 7bf88d0e25
Add TPS (#117)
* Add TPS

* Update tps_preprocessor.py

* Add licence, change variable name and format

* renamed some parameters and add tests of ocr preprocessor

* renamed params

* Update tps_preprocessor.py

* add config file and readme for TPS
2021-04-28 07:39:13 +00:00
Hongbin Sun 43dcb32d4f
Hbsun/end2end demo (#105)
* add end2end demo

* fix typo

* pad box

* fix bug of crnn

* fix polygon

* update docstring

* fix bug of polygon

* updare demo api

* fix except

* rename

* fix with comments
2021-04-22 20:42:42 +08:00
Hongbin Sun f5c385b02c
fix inference bug (#87)
* fix inference bug

* add unit test for det
2021-04-19 02:07:25 +00:00
Sergio Bugallo Enjamio a68de2214a
Add support for numpy array inference (#74)
* Add support for numpy arrays in model_inference

* Add test for numpy ndarray inference

* Fix linting problems

* Simplify assertion in model_inference
2021-04-18 20:10:17 +08:00
Hongbin Sun 524498479f
add unit test for textsnake (#61) 2021-04-13 21:59:19 +08:00
Hongbin Sun 344cc9a38d
Add unittest for kie (#56)
* add unittest for sdmgr

* fix #36: update datasets.md

* unittest pass
2021-04-13 13:58:31 +08:00
Hongbin Sun c345255e49
remove test for textsnake (#8) 2021-04-08 03:07:22 +00:00
Hongbin Sun 7acfabb482
fix pytest error (#6) 2021-04-08 01:48:15 +08:00
lizz 44ca9c2a61
Remove usage of \ (#49)
* Remove usage of \

Signed-off-by: lizz <lizz@sensetime.com>

* rebase

Signed-off-by: lizz <lizz@sensetime.com>

* typos

Signed-off-by: lizz <lizz@sensetime.com>

* Remove test dependency on tools/

Signed-off-by: lizz <lizz@sensetime.com>

* Remove usage of \

Signed-off-by: lizz <lizz@sensetime.com>

* rebase

Signed-off-by: lizz <lizz@sensetime.com>

* typos

Signed-off-by: lizz <lizz@sensetime.com>

* Remove test dependency on tools/

Signed-off-by: lizz <lizz@sensetime.com>

* typo

Signed-off-by: lizz <lizz@sensetime.com>

* KIE in keywords

Signed-off-by: lizz <lizz@sensetime.com>

* some renames

Signed-off-by: lizz <lizz@sensetime.com>

* kill isort skip

Signed-off-by: lizz <lizz@sensetime.com>

* aggregation discrimination

Signed-off-by: lizz <lizz@sensetime.com>

* aggregation discrimination

Signed-off-by: lizz <lizz@sensetime.com>

* tiny

Signed-off-by: lizz <lizz@sensetime.com>

* fix bug: model infer on cpu

Co-authored-by: Hongbin Sun <hongbin306@gmail.com>
2021-04-06 12:16:46 +00:00
Theo Chan cbb4ec349b
Textsnake tests (#51)
* add textsnake unit tests
2021-04-06 18:20:43 +08:00
Hongbin Sun 03a270d2c2
fix #47: add unit test for api (#48) 2021-04-06 08:04:14 +00:00
Hongbin Sun fbb5c8cda1
fix #40: add unit test for recog config, transforms, etc. (#44) 2021-04-06 07:17:20 +00:00
jeffreykuang c8793ac141
Add textdet unit tests (#43)
* Fix #41: test fpn_cat

* Fix #41: test fpn_cat

* Fix #41: test fpn_cat
2021-04-06 07:16:27 +00:00
Hongbin Sun aa87b69f12
fix #37: remove useless code (#38) 2021-04-06 03:40:48 +00:00
lizz 7e281521cf skip cuda
Signed-off-by: lizz <lizz@sensetime.com>
2021-04-06 10:58:45 +08:00
Hongbin Sun 06fee8328b fix #31: pytest pass 2021-04-06 10:58:45 +08:00
lizz 09ffd284ee Remove test dependency on tools
Signed-off-by: lizz <lizz@sensetime.com>
2021-04-06 10:57:25 +08:00
lizz b153cc01c8 Re-enable skipped test
Signed-off-by: lizz <lizz@sensetime.com>
2021-04-06 10:57:25 +08:00
lizz 2ad699e099 fix
Signed-off-by: lizz <lizz@sensetime.com>
2021-04-06 10:57:25 +08:00
Hongbin Sun 0f00378f9a
Feature/iss 33 (#34)
* fix #33: update dataset.md

* fix #33: pytest for transformer related
2021-04-05 23:54:57 +08:00
jeffreykuang 31f1c007c0 [feature]: add textdet 2021-04-03 01:03:52 +08:00
Hongbin Sun 4ecd0cea8a add sar, seg and other components 2021-04-02 23:54:57 +08:00