|
|
před 4 měsíci | |
|---|---|---|
| .. | ||
| base | před 4 měsíci | |
| config | před 4 měsíci | |
| data_loader | před 4 měsíci | |
| imgs | před 4 měsíci | |
| models | před 4 měsíci | |
| post_processing | před 4 měsíci | |
| test | před 4 měsíci | |
| test_tipc | před 4 měsíci | |
| tools | před 4 měsíci | |
| trainer | před 4 měsíci | |
| utils | před 4 měsíci | |
| .gitattributes | před 4 měsíci | |
| .gitignore | před 4 měsíci | |
| LICENSE.md | před 4 měsíci | |
| README.MD | před 4 měsíci | |
| environment.yml | před 4 měsíci | |
| eval.sh | před 4 měsíci | |
| generate_lists.sh | před 4 měsíci | |
| multi_gpu_train.sh | před 4 měsíci | |
| predict.sh | před 4 měsíci | |
| requirement.txt | před 4 měsíci | |
| single_gpu_train.sh | před 4 měsíci | |
note: some code is inherited from WenmuZhou/DBNet.pytorch
2020-06-07: 添加灰度图训练,训练灰度图时需要在配置里移除dataset.args.transforms.Normalize
conda env create -f environment.yml
git clone https://github.com/WenmuZhou/DBNet.paddle.git
cd DBNet.paddle/
or
conda create -n dbnet python=3.6
conda activate dbnet
conda install ipython pip
# python dependencies
pip install -r requirement.txt
# clone repo
git clone https://github.com/WenmuZhou/DBNet.paddle.git
cd DBNet.paddle/
TBD
Training data: prepare a text train.txt in the following format, use '\t' as a separator
./datasets/train/img/001.jpg ./datasets/train/gt/001.txt
Validation data: prepare a text test.txt in the following format, use '\t' as a separator
./datasets/test/img/001.jpg ./datasets/test/gt/001.txt
img foldergt folderThe groundtruth can be .txt files, with the following format:
x1, y1, x2, y2, x3, y3, x4, y4, annotation
dataset['train']['dataset'['data_path']',dataset['validate']['dataset'['data_path']in config/icdar2015_resnet18_fpn_DBhead_polyLR.yaml. single gpu train
bash single_gpu_train.sh
. Multi-gpu training
bash multi_gpu_train.sh
eval.py is used to test model on test dataset
model_path in eval.shuse following script to test
bash eval.sh
predict.py Can be used to inference on all images in a folder
model_path,input_folder,output_folder in predict.shuse following script to predict
bash predict.sh
You can change the model_path in the predict.sh file to your model location.
tips: if result is not good, you can change thre in predict.sh
export_model.py Can be used to inference on all images in a folder
use following script to export inference model
python tools/export_model.py --config_file config/icdar2015_resnet50_FPN_DBhead_polyLR.yaml -o trainer.resume_checkpoint=model_best.pth trainer.output_dir=output/infer
infer.py Can be used to inference on all images in a folder
use following script to export inference model
python tools/infer.py --model-dir=output/infer/ --img-path imgs/paper/db.jpg
only train on ICDAR2015 dataset
| Method | image size (short size) | learning rate | Precision (%) | Recall (%) | F-measure (%) | FPS |
|---|---|---|---|---|---|---|
| ImageNet-resnet50-FPN-DBHead(torch) | 736 | 1e-3 | 90.19 | 78.14 | 83.88 | 27 |
| ImageNet-resnet50-FPN-DBHead(paddle) | 736 | 1e-3 | 89.47 | 79.03 | 83.92 | 27 |
| ImageNet-resnet50-FPN-DBHead(paddle_amp) | 736 | 1e-3 | 88.62 | 79.95 | 84.06 | 27 |
TBD
If this repository helps you,please star it. Thanks.