Skip to content

Commit 44b2307

Browse files
authored
refine readme (#168)
* readme * readme * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md
1 parent 0c3f452 commit 44b2307

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@ mIOUs on cocostuff val2017 set:
1616
| bisenetv1 | 31.49 | 31.42 | 32.46 | 32.55 | [download](https://github.com/CoinCheung/BiSeNet/releases/download/0.0.0/model_final_v1_coco_new.pth) |
1717
| bisenetv2 | 30.49 | 30.55 | 31.81 | 31.73 | [download](https://github.com/CoinCheung/BiSeNet/releases/download/0.0.0/model_final_v2_coco.pth) |
1818

19-
> Where **ss** means single scale evaluation, **ssc** means single scale crop evaluation, **msf** means multi-scale evaluation with flip augment, and **mscf** means multi-scale crop evaluation with flip evaluation. The eval scales and crop size of multi-scales evaluation can be found in [configs](./configs/).
19+
Tips:
20+
1. **ss** means single scale evaluation, **ssc** means single scale crop evaluation, **msf** means multi-scale evaluation with flip augment, and **mscf** means multi-scale crop evaluation with flip evaluation. The eval scales and crop size of multi-scales evaluation can be found in [configs](./configs/).
2021

21-
> The fps is tested in different way from the paper. For more information, please see [here](./tensorrt).
22+
2. The fps is tested in different way from the paper. For more information, please see [here](./tensorrt).
2223

23-
> For cocostuff dataset: The authors of the paper `bisenetv2` used the "old split" of 9k train set and 1k val set, while I used the "new split" of 118k train set and 5k val set. Thus the above results on cocostuff does not match the paper. The authors of bisenetv1 did not report their results on cocostuff, so here I simply provide a "make it work" result. Following the tradition of object detection, I used "1x"(90k) and "2x"(180k) schedule to train bisenetv1(1x) and bisenetv2(2x) respectively. Maybe you can have a better result by picking up hyper-parameters more carefully.
24+
3. For cocostuff dataset: The authors of the paper `bisenetv2` used the "old split" of 9k train set and 1k val set, while I used the "new split" of 118k train set and 5k val set. Thus the above results on cocostuff does not match the paper. The authors of bisenetv1 did not report their results on cocostuff, so here I simply provide a "make it work" result. Following the tradition of object detection, I used "1x"(90k) and "2x"(180k) schedule to train bisenetv1(1x) and bisenetv2(2x) respectively. Maybe you can have a better result by picking up hyper-parameters more carefully.
2425

25-
Note that the model has a big variance, which means that the results of training for many times would vary within a relatively big margin. For example, if you train bisenetv2 for many times, you will observe that the result of **ss** evaluation of bisenetv2 varies between 73.1-75.1.
26+
4. The model has a big variance, which means that the results of training for many times would vary within a relatively big margin. For example, if you train bisenetv2 for many times, you will observe that the result of **ss** evaluation of bisenetv2 varies between 73.1-75.1.
27+
28+
29+
## deploy trained models
30+
1. tensorrt
31+
You can go to [tensorrt](./tensorrt) for details.
32+
33+
2. ncnn
34+
You can go to [ncnn](./ncnn) for details.
2635

2736

2837
## platform
@@ -132,9 +141,6 @@ You can also evaluate a trained model like this:
132141
$ python tools/evaluate.py --config configs/bisenetv1_city.py --weight-path /path/to/your/weight.pth
133142
```
134143

135-
## Infer with tensorrt
136-
You can go to [tensorrt](./tensorrt) For details.
137-
138144

139145
### Be aware that this is the refactored version of the original codebase. You can go to the `old` directory for original implementation if you need, though I believe you will not need it.
140146

ncnn/README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,55 +13,57 @@ Though this demo runs on x86 platform, you can also use it on mobile platforms.
1313

1414
### Install ncnn
1515

16-
1. dependencies
17-
```
18-
$ python -m pip install onnx-simplifier
19-
```
16+
#### 1. dependencies
17+
```
18+
$ python -m pip install onnx-simplifier
19+
```
2020

21-
2. build ncnn
22-
Just following the ncnn official tutoral: [build-for-linux](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux) to install ncnn:
21+
#### 2. build ncnn
22+
Just follow the ncnn official tutoral of [build-for-linux](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux) to install ncnn:
2323

24-
1) dependencies
24+
**step 1:** install dependencies
2525
```
2626
# apt install build-essential git libprotobuf-dev protobuf-compiler
2727
```
2828

29-
2) (optional) install vulkan
29+
**step 2:** (optional) install vulkan
3030

31-
3) install opencv from source
31+
**step 3:** install opencv from source
3232

33-
4) build
33+
**step 4:** build
34+
I am using commit `9391fae741a1fb8d58cdfdc92878a5e9800f8567`, and I have not tested over newer commits.
3435
```
35-
## I am using commit 9391fae741a1fb8d58cdfdc92878a5e9800f8567, and I have not tested over newer commits
3636
$ git clone https://github.com/Tencent/ncnn.git
37-
$ $cd ncnn
37+
$ cd ncnn
3838
$ git submodule update --init
3939
$ mkdir -p build
4040
$ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc.toolchain.cmake ..
4141
$ make -j
4242
$ make install
4343
```
4444

45-
### convert model, build and run the demo
45+
### Convert model, build and run the demo
4646

47-
1. convert pytorch model to ncnn model via onnx
47+
#### 1. convert pytorch model to ncnn model via onnx
4848
```
4949
$ cd BiSeNet/
5050
$ python tools/export_onnx.py --aux-mode eval --config configs/bisenetv2_city.py --weight-path /path/to/your/model.pth --outpath ./model_v2.onnx
5151
$ python -m onnxsim model_v2.onnx model_v2_sim.onnx
5252
$ /path/to/ncnn/build/tools/onnx/onnx2ncnn model_v2_sim.onnx model_v2_sim.param model_v2_sim.bin
53+
$ mkdir -p ncnn/moidels
5354
$ mv model_v2_sim.param ncnn/models
5455
$ mv model_v2_sim.bin ncnn/models
5556
```
5657

57-
2. compile demo code
58+
#### 2. compile demo code
5859
```
60+
mkdir -p ncnn/build
5961
cd ncnn/build
6062
cmake .. -DNCNN_ROOT=/path/to/ncnn/build/install
6163
make
6264
```
6365

64-
3. run demo
66+
#### 3. run demo
6567
```
6668
./segment
6769
```

0 commit comments

Comments
 (0)