duan8/DBNet
2020-11-06 22:22:23 +08:00
..
CMakeLists.txt 自然场景文字检测DBNet 2020-11-06 22:19:39 +08:00
common.hpp 自然场景文字检测DBNet 2020-11-06 22:19:39 +08:00
dbnet.cpp 自然场景文字检测DBNet 2020-11-06 22:19:39 +08:00
logging.h 自然场景文字检测DBNet 2020-11-06 22:19:39 +08:00
README.md Update README.md 2020-11-06 22:22:23 +08:00
utils.h 自然场景文字检测DBNet 2020-11-06 22:19:39 +08:00

DBNet

The Pytorch implementation is DBNet.

How to Run

win版本请看最后的链接。

  • 1 生成wts 从pytoch仓库下载到代码和模型。配置好环境后

    在tools/predict.py中将save_wts属性置为True运行后就在在tools文件夹下生成wts文件。

    同时也可以导出onnx。将onnx属性设置为True即可。

  • 2 cmake 生成工程

    mkdir build
    cd build
    cmake ..
    make
    sudo ./dbnet -s             // serialize model to plan file i.e. 'DBNet.engine'
    sudo ./dbnet -d  ../samples // deserialize plan file and run inference, the images in samples will be processed.
    

windows版本

https://github.com/BaofengZan/DBNet-TensorRT

不足之处

  • 1 common文件中下面两个函数可以合并自己偷了个懒。
ILayer* convBnLeaky(INetworkDefinition *network, std::map<std::string, Weights>& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true) 
ILayer* convBnLeaky2(INetworkDefinition *network, std::map<std::string, Weights>& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true)
  • 2 后处理中与pytorch版本也有好多不同之处这都是可以改进提升的。
  • 3 在pyorch中数据预处理是将图像短边resize到1024长边按比例缩放最后将新的宽高截到32的倍数。而在自己的repo中直接将图像resize到640*640较为粗暴。