From 12f7c1b8b103b1fba60daed15d6ce35c50b0319b Mon Sep 17 00:00:00 2001 From: PeterH0323 Date: Thu, 8 Apr 2021 10:52:33 +0800 Subject: [PATCH] Improve DBNet README.md (#467) * Fix: syntax error in common.hpp , cuda & tensorrt not included in CMakeLists.txt * Fix: layer warining while building in common.hpp and denet.cpp * Fix: NOT droping mini boxes and low score boxes. * Fix: The prediction boxes are NOT expanded by the specified proportion, which will lead to serious errors * Improve DBNet README * Improve DBNet README * Improve DBNet README --- dbnet/README.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/dbnet/README.md b/dbnet/README.md index dd9d20f..04cae75 100644 --- a/dbnet/README.md +++ b/dbnet/README.md @@ -3,19 +3,20 @@ The Pytorch implementation is [DBNet](https://github.com/BaofengZan/DBNet.pytorch).

- +

+ ## How to Run -* 1. generate .wts +* 1. generate `.wts` Download code and model from [DBNet](https://github.com/BaofengZan/DBNet.pytorch) and config your environments. - In tools/predict.py, set `save_wts` as `True`, and run, the .wts will be generated. + Go to file`tools/predict.py`, set `--save_wts` as `True`, then run, the `DBNet.wts` will be generated. - onnx can also be exported, just need to set `onnx` as `True`. + Onnx can also be exported, just need to set `--onnx` as `True`. * 2. cmake and make @@ -24,28 +25,32 @@ The Pytorch implementation is [DBNet](https://github.com/BaofengZan/DBNet.pytorc cd build cmake .. make + cp /your_wts_path/DBNet.wts . 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. + sudo ./dbnet -d ./test_imgs // deserialize plan file and run inference, all images in test_imgs folder will be processed. ``` + ## For windows https://github.com/BaofengZan/DBNet-TensorRT + + ## Todo -* 1. ~~In common.hpp, the following two functions can be merged.~~ +- [x] 1. In `common.hpp`, the following two functions can be merged. -```c++ -ILayer* convBnLeaky(INetworkDefinition *network, std::map& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true) -``` + ```c++ + ILayer* convBnLeaky(INetworkDefinition *network, std::map& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true) + ``` -```c++ -ILayer* convBnLeaky2(INetworkDefinition *network, std::map& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true) -``` + ```c++ + ILayer* convBnLeaky2(INetworkDefinition *network, std::map& weightMap, ITensor& input, int outch, int ksize, int s, int g, std::string lname, bool bias = true) + ``` -* 2. The postprocess method here should be optimized, which is a little different from pytorch side. +- [x] 2. The postprocess method here should be optimized, which is a little different from pytorch side. -* 3. ~~The input image here is resized to 640x640 directly, while the pytorch side is using `letterbox` method.~~ +- [x] 3. The input image here is resized to `640 x 640` directly, while the pytorch side is using `letterbox` method.