Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Matting] Fix a bug caused by opencv version #2027

Merged
merged 308 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
25852a0
update unet.py
wuyefeilin Jan 4, 2021
9cede49
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 4, 2021
1634a5f
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Jan 5, 2021
ca8d5da
add flops calculation
wuyefeilin Jan 8, 2021
3c84175
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 8, 2021
e559aa2
rm prepare_context
wuyefeilin Jan 13, 2021
840583a
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 13, 2021
47d39e7
add amp
wuyefeilin Jan 18, 2021
c03e343
update static api to paddle2.0
wuyefeilin Jan 20, 2021
c95b82f
add LimitLong transform
wuyefeilin Jan 14, 2021
3a2ca98
align the dygraph structure
wuyefeilin Jan 20, 2021
e423131
add static amp
wuyefeilin Jan 22, 2021
dc3032c
dygraph add parameters to control amp
wuyefeilin Jan 22, 2021
850b564
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 22, 2021
f1cf052
update time calculation
wuyefeilin Jan 22, 2021
2f49ebf
add instruction
wuyefeilin Jan 22, 2021
dddeec3
Merge pull request #798 from wuyefeilin/benchmark_amp_dis
wuyefeilin Jan 22, 2021
b596274
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 26, 2021
4080e5e
update dataset raise information
wuyefeilin Jan 27, 2021
552fd5c
rm unused config files
wuyefeilin Jan 27, 2021
a9b241e
update align corners True to False
wuyefeilin Jan 28, 2021
0c93c27
update hrentw18 config file
wuyefeilin Jan 28, 2021
d0517a7
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 28, 2021
7487e5c
update train.py
wuyefeilin Jan 29, 2021
0e6153c
update deeplabv3p_resnet50_vd_cityscapes.yaml
wuyefeilin Jan 29, 2021
8d08478
add bias config to fcn head for hrnet
wuyefeilin Jan 29, 2021
a451ff8
using BatchNorm in one gpu
wuyefeilin Feb 1, 2021
ad006be
update README.md
wuyefeilin Feb 1, 2021
885be06
Merge pull request #814 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 1, 2021
8d5a242
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Feb 1, 2021
dde3ea8
Update README.md
wuyefeilin Feb 1, 2021
e53f110
Merge pull request #816 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 1, 2021
84dff5d
add config check module
wuyefeilin Feb 1, 2021
eb58770
update config.py
wuyefeilin Feb 2, 2021
20f73d0
update num_classes check
wuyefeilin Feb 2, 2021
7e28e99
add config check to predict.py
wuyefeilin Feb 2, 2021
d5805bd
Update README.md
wuyefeilin Feb 2, 2021
39552b6
Merge pull request #819 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 2, 2021
939109d
Update layer_libs.py
wuyefeilin Feb 2, 2021
e1bc66e
Merge pull request #821 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 2, 2021
9c42db3
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Feb 6, 2021
dba30d5
paddleseg/core/train.py
wuyefeilin Feb 6, 2021
f93df11
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Feb 7, 2021
e0c1c85
update README.md
wuyefeilin Feb 7, 2021
20254cf
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Feb 8, 2021
e881e11
Merge pull request #843 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 22, 2021
519abd5
add dygraph fleet
wuyefeilin Feb 22, 2021
bc02429
fix padding to symmetry
wuyefeilin Feb 23, 2021
4fd3da6
Merge pull request #847 from wuyefeilin/benchmark_amp_dis
wuyefeilin Feb 23, 2021
19c5702
add fleet to static
wuyefeilin Feb 24, 2021
7ecb72f
update README.md
wuyefeilin Feb 25, 2021
638a544
fix fp16 to fleet and add interpolate to black list
wuyefeilin Feb 25, 2021
7078655
add fleet to static
wuyefeilin Feb 24, 2021
abafbb6
update README.md
wuyefeilin Feb 25, 2021
ead484f
fix fp16 to fleet and add interpolate to black list
wuyefeilin Feb 25, 2021
9b820d1
update hrnet config
wuyefeilin Feb 26, 2021
45129e9
update some
wuyefeilin Feb 26, 2021
60d47ba
update hrnetw18_cityscapes_1024x512_215.yaml
wuyefeilin Feb 27, 2021
92dce23
update hrnet.yml
wuyefeilin Feb 28, 2021
a2dfcc3
update train.py
wuyefeilin Mar 1, 2021
d4c1a05
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 1, 2021
72123af
fix fleetrun bug
wuyefeilin Mar 2, 2021
5b66017
Merge branch 'benchmark' of https://github.com/PaddlePaddle/PaddleSeg…
wuyefeilin Mar 5, 2021
fd6a7ca
Merge pull request #858 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 5, 2021
b8a29bb
fix syncbn in fleet
wuyefeilin Mar 10, 2021
65b0504
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 10, 2021
48fd976
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Mar 10, 2021
dcd91fd
update deeplabv3p_resnet101_os8_voc12aug_512x512_40k.yml
wuyefeilin Mar 10, 2021
440e006
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 12, 2021
dc3a691
fix variable confict
wuyefeilin Mar 12, 2021
2068958
Merge pull request #875 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 12, 2021
9ea41f0
update time calculation
wuyefeilin Mar 15, 2021
b2d6fbb
Merge pull request #881 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 15, 2021
d83e171
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 15, 2021
32fb9eb
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 15, 2021
0b9fcb3
update logger format
wuyefeilin Mar 15, 2021
a5b8bb6
update logger format
wuyefeilin Mar 15, 2021
ae91105
Merge pull request #889 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 17, 2021
38d2cba
update deeplabv3p.yml
wuyefeilin Mar 17, 2021
3cbf3e3
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 17, 2021
fd967f9
fix ade label bug
wuyefeilin Mar 17, 2021
64d6eb8
suport NHWC data format for DeepLabv3+
wuyefeilin Mar 19, 2021
8b79ebe
Merge pull request #904 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 19, 2021
b3ce899
fix the data_format bug
wuyefeilin Mar 22, 2021
e90a53e
Merge pull request #910 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 22, 2021
cc8b349
fix the data_format bug
wuyefeilin Mar 23, 2021
15d04a6
Merge pull request #912 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 23, 2021
33e3cc5
fix data_format for evaluation
wuyefeilin Mar 29, 2021
595ddfb
Merge pull request #924 from wuyefeilin/benchmark_amp_dis
wuyefeilin Mar 29, 2021
d7dfcf7
add script for fp16 training
zhangting2020 Mar 30, 2021
c44de62
add script for fp32 training
zhangting2020 Mar 30, 2021
a7bcc8a
Merge pull request #928 from zhangting2020/benchmark
wuyefeilin Mar 31, 2021
79ce1c1
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 16, 2021
a598693
fix reverse for ResizeByLong
wuyefeilin Apr 16, 2021
99f2ba4
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Apr 16, 2021
436178d
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 20, 2021
1a544d7
fix decouplde_segnet grad bug
wuyefeilin Apr 20, 2021
5701757
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 26, 2021
3b3aaa8
add panoptic segmentation
wuyefeilin Apr 27, 2021
db18e81
update README.md
wuyefeilin Apr 27, 2021
da06a8a
update README.md
wuyefeilin Apr 27, 2021
b103f03
fit to paddle2.1
wuyefeilin Apr 29, 2021
bcf10a6
Merge pull request #996 from wuyefeilin/benchmark_amp_dis
wuyefeilin Apr 29, 2021
07c6622
fit to paddle2.1
wuyefeilin May 8, 2021
5a38454
Merge pull request #1009 from wuyefeilin/benchmark_amp_dis
wuyefeilin May 8, 2021
ab0bb01
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin May 8, 2021
03b53b3
update README.md
wuyefeilin May 8, 2021
318dd24
sync_batch_norm supports amp
sljlp May 10, 2021
36652c6
Merge pull request #1014 from sljlp/benchmark
wuyefeilin May 10, 2021
7469f40
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin May 10, 2021
a43d180
rm paddleseg
wuyefeilin May 10, 2021
cc79ca6
update train process
wuyefeilin May 10, 2021
de2b311
update val process
wuyefeilin May 10, 2021
175dde7
update predict process
wuyefeilin May 10, 2021
c492f87
update models
wuyefeilin May 11, 2021
b8f3fac
recover to origin
wuyefeilin May 11, 2021
69ac997
update README.md
wuyefeilin May 11, 2021
b709791
rm some useless
wuyefeilin May 11, 2021
fe2e107
mv loss to paddleseg
wuyefeilin May 11, 2021
c3abf0c
update copyright
wuyefeilin May 19, 2021
def908a
format import
wuyefeilin May 19, 2021
d831eba
update annotations
wuyefeilin May 19, 2021
a377547
update annotations
wuyefeilin May 19, 2021
4f5e301
update copyright and annotations
wuyefeilin May 19, 2021
d985bb9
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin May 19, 2021
42c248c
first add matting
wuyefeilin Jun 4, 2021
1767f95
update train.py
wuyefeilin Jun 6, 2021
8951da9
add stage params and add argparse to train
wuyefeilin Jun 7, 2021
31520a0
upsample by deconv
wuyefeilin Jun 7, 2021
890ff4b
add evaluation process
wuyefeilin Jun 8, 2021
d888cb3
using trimap if existing during evaluation
wuyefeilin Jun 8, 2021
1acaf1d
update transforms.py
wuyefeilin Jun 8, 2021
344c70a
update dataset.py
wuyefeilin Jun 8, 2021
9d1ce7e
add skip connec and update refinenet
wuyefeilin Jun 9, 2021
9a129c5
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jun 11, 2021
aaa0b23
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jun 11, 2021
2e2ace0
Merge branch 'benchmark' into develop
wuyefeilin Jun 11, 2021
9681a07
update static config location
wuyefeilin Jun 11, 2021
830fcdc
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Jun 15, 2021
7f9140a
add origin legacy thing
wuyefeilin Jun 15, 2021
2042499
rm warmup and cosine_decay
wuyefeilin Jun 15, 2021
dd70e90
alignalign dygraph
wuyefeilin Jun 16, 2021
5d07585
align dygraph
wuyefeilin Jun 16, 2021
5432480
update README.md
wuyefeilin Jun 16, 2021
28f8a53
update solver.py
wuyefeilin Jun 16, 2021
5ef6a75
update train.py
wuyefeilin Jun 18, 2021
f472cad
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jun 18, 2021
d93247d
Update model_libs.py
wuyefeilin Jun 22, 2021
ff23886
Update README.md
nepeplwu Jun 22, 2021
462b309
evaluation while training
wuyefeilin Jun 22, 2021
a0ff2bf
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jun 29, 2021
1d1075b
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Jul 1, 2021
f4fd6a2
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jul 7, 2021
97b46ae
add panoptice segmentation link
wuyefeilin Jul 7, 2021
bf50598
add resnet backbone
wuyefeilin Jul 7, 2021
63e8d6b
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jul 8, 2021
de2ebf1
update shape
wuyefeilin Jul 8, 2021
258a418
add grad and conn evaluation
wuyefeilin Jul 9, 2021
f1b79c6
update loss.py
wuyefeilin Jul 12, 2021
f43cf04
rm grad and conn evaluation
wuyefeilin Jul 13, 2021
f474b02
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jul 23, 2021
63b29ff
rm README.md
wuyefeilin Jul 23, 2021
41f41c7
update metric
wuyefeilin Jul 26, 2021
de60dee
update gen_dataset.py
wuyefeilin Jul 26, 2021
ce052fc
add human matte dataset
wuyefeilin Jul 26, 2021
549d539
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Aug 5, 2021
52ebbcf
update cross_entropy_loss.py
wuyefeilin Aug 5, 2021
4c7ed0a
add modnet
wuyefeilin Aug 11, 2021
d5dbdf5
update modenet.py
wuyefeilin Aug 11, 2021
a8c0c67
add consistent loss and update L1Loss
wuyefeilin Aug 13, 2021
afecce3
update human_matting_dataset.py
wuyefeilin Aug 16, 2021
8f10a47
update dataset
wuyefeilin Aug 16, 2021
ecd870e
add resize by short
wuyefeilin Aug 18, 2021
a47a526
add resizebyshort transform
wuyefeilin Aug 20, 2021
de97bab
d10, fcsstop
wuyefeilin Aug 27, 2021
e98b762
add RandomBlur aug
wuyefeilin Sep 22, 2021
1e06fc9
add distort aug
wuyefeilin Sep 23, 2021
b842915
add predict function
wuyefeilin Sep 23, 2021
de02720
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Sep 23, 2021
fdd7ecf
Merge branch 'matting_modnet' into develop
wuyefeilin Sep 23, 2021
1f4450d
merge dim network
wuyefeilin Sep 26, 2021
9cd6b74
add configs of modnet
wuyefeilin Sep 26, 2021
e397f99
update config.py
wuyefeilin Sep 26, 2021
f49cd3d
rm tools some
wuyefeilin Sep 26, 2021
75d69f9
update dataset name
wuyefeilin Sep 26, 2021
bea3e1d
update models
wuyefeilin Sep 26, 2021
b1b0056
update modnet.py
wuyefeilin Sep 27, 2021
a571283
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Sep 27, 2021
477407f
Merge branch 'develop' of https://github.com/wuyefeilin/PaddleSeg int…
wuyefeilin Sep 27, 2021
31a07ab
realize prediction
wuyefeilin Sep 27, 2021
3870629
update train procession
wuyefeilin Sep 27, 2021
efc8b36
add docs and configs
wuyefeilin Sep 27, 2021
8b3de26
update README.md
wuyefeilin Sep 27, 2021
581fac8
update some
wuyefeilin Sep 28, 2021
cbe2419
raname matting to Matting
wuyefeilin Sep 28, 2021
f1b7298
update train.py
wuyefeilin Sep 28, 2021
9232bff
update some
wuyefeilin Sep 28, 2021
3575858
update README.md
wuyefeilin Sep 28, 2021
f3f389d
update pretrained model and distributed training
wuyefeilin Sep 28, 2021
520bc75
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Sep 28, 2021
2203180
merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Sep 28, 2021
46fbd07
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Oct 8, 2021
beecdfa
add hrnet and resnet backbone
wuyefeilin Oct 12, 2021
ca685dc
first add ziyan
wuyefeilin Oct 19, 2021
b983c7b
update model
wuyefeilin Oct 20, 2021
3bd5850
add RandomResize transform
wuyefeilin Oct 27, 2021
bec24f1
add Padding transform
wuyefeilin Oct 27, 2021
6e8c61b
add refinement module
wuyefeilin Oct 28, 2021
bb50840
fix bug
wuyefeilin Oct 29, 2021
2592e11
update glance loss
wuyefeilin Nov 1, 2021
48be067
optimize crop_patch and replace_patch
wuyefeilin Nov 1, 2021
6709be6
update ziyan.py
wuyefeilin Nov 1, 2021
779cbae
update Padding
wuyefeilin Nov 2, 2021
927cfdd
add LimitShort
wuyefeilin Nov 2, 2021
e2ea87f
update RandomResize
wuyefeilin Nov 2, 2021
ae1e2b6
fix trimap resize
wuyefeilin Nov 3, 2021
1c600c0
add vdl visualization
wuyefeilin Nov 4, 2021
e2231cd
delete unnecessary keys
wuyefeilin Nov 7, 2021
c085ff8
update ziyan.py
wuyefeilin Nov 10, 2021
4af4999
add gcb of gcnet
wuyefeilin Nov 23, 2021
c0511ac
add gate
wuyefeilin Nov 24, 2021
7667885
pp-matting-v0.4.1
wuyefeilin Nov 29, 2021
28118f6
pp-matting-v0.4.2
wuyefeilin Nov 29, 2021
065ddeb
add RandomSharpen RandomNoise RandomReJpeg transforms
wuyefeilin Dec 15, 2021
0ca02db
add RSSN
wuyefeilin Dec 17, 2021
6ac7004
add `if_rssn` param
wuyefeilin Dec 22, 2021
b31e2e7
update composition loss
wuyefeilin Dec 23, 2021
8ab2672
add gradient loss and fix model loss_func_dict generation
wuyefeilin Dec 24, 2021
f2aaaa9
Resize add interp random
wuyefeilin Dec 28, 2021
cc8c581
add grad and conn metric, save best metic to best.txt
wuyefeilin Jan 7, 2022
a9073aa
add english doc
wuyefeilin Jan 10, 2022
76813d8
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 11, 2022
94b1a83
update transforms.py
wuyefeilin Jan 11, 2022
897908c
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 19, 2022
dd0b3b6
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Jan 19, 2022
a529fe3
add random shuffle for file list
wuyefeilin Feb 9, 2022
e9b0ba5
update matting_dataset.py
wuyefeilin Jan 17, 2022
52fb663
tag pp-matting
wuyefeilin Mar 22, 2022
0b77248
add export
wuyefeilin Mar 23, 2022
4ede547
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Mar 30, 2022
7925de9
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 1, 2022
d49cc68
Merge branch 'matting' into develop
wuyefeilin Apr 2, 2022
751c415
update some annotation
wuyefeilin Apr 2, 2022
211c59b
update README
wuyefeilin Apr 2, 2022
0b3cd86
update README
wuyefeilin Apr 6, 2022
77d499e
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 6, 2022
65812ef
update README
wuyefeilin Apr 6, 2022
92de885
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 14, 2022
ba02129
Merge branch 'develop' of https://github.com/PaddlePaddle/PaddleSeg i…
wuyefeilin Apr 19, 2022
1303f03
fix opencv-python version
wuyefeilin Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add english doc
  • Loading branch information
wuyefeilin committed Jan 11, 2022
commit a9073aa44e8812ae42674b862a4460e9cf116321
29 changes: 16 additions & 13 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# PaddleSeg 下benchmark模型执行说明
English | [简体中文](README_CN.md)

# Benchmark Introduction

The content is as follow:

```
├── README.md
├── configs
│   ├── cityscapes_30imgs.yml
Expand All @@ -13,25 +18,23 @@
├── run_benchmark.sh
├── run_fp16.sh
└── run_fp32.sh
## 环境
使用Docker配置Paddle的GPU环境。
```

## Environment
Use Docker to configure the environment.
* docker image: paddlepaddle/paddle:latest-gpu-cuda10.1-cudnn7
* CUDA 10.1 + cudnn7
* paddle=2.1.2
* py=37
## 测试步骤
### 执行训练Benchmark测试

## Test
### Training Test

```
git clone https://github.com/PaddlePaddle/PaddleSeg.git
cd PaddleSeg
bash benchmark/run_all.sh
```
### Profiling开关使用方式
```bash
# 调用train.py时加上该参数 --profiler_options="batch_range=[50, 60]; profile_path=model.profile"
```




### How to Open Profiling
Add the following parameter when training.
`--profiler_options="batch_range=[50, 60]; profile_path=model.profile`
39 changes: 39 additions & 0 deletions benchmark/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
简体中文 | [English](README.md)

# Benchmark说明

目录结构如下:
```
├── README.md
├── configs
│   ├── cityscapes_30imgs.yml
│   ├── fastscnn.yml
│   ├── ocrnet_hrnetw48.yml
│   └── segformer_b0.yml
├── deeplabv3p.yml
├── hrnet.yml
├── hrnet48.yml
├── run_all.sh
├── run_benchmark.sh
├── run_fp16.sh
└── run_fp32.sh
```
## 环境
使用Docker配置环境。
* docker image: paddlepaddle/paddle:latest-gpu-cuda10.1-cudnn7
* CUDA 10.1 + cudnn7
* paddle=2.1.2
* py=37

## 测试

### 训练测试

```
git clone https://github.com/PaddlePaddle/PaddleSeg.git
cd PaddleSeg
bash benchmark/run_all.sh
```
### Profiling开关使用方式
训练时添加如下参数
`--profiler_options="batch_range=[50, 60]; profile_path=model.profile`
112 changes: 56 additions & 56 deletions contrib/Matting/deploy/human_matting_android_demo/README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
English | [简体中文](README_CN.md)

# Human Matting Android Demo
基于[PaddleSeg](https://github.com/paddlepaddle/paddleseg/tree/develop)[MODNet](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/contrib/Matting)算法实现人像抠图(安卓版demo)。
Based on [PaddleSeg](https://github.com/paddlepaddle/paddleseg/tree/develop)[MODNet](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/contrib/Matting) algorithm to realise human matting(Android demo).

可以直接下载安装本示例工程中的[apk](https://paddleseg.bj.bcebos.com/matting/models/deploy/app-debug.apk)进行体验
You can directly download and install the example project [apk](https://paddleseg.bj.bcebos.com/matting/models/deploy/app-debug.apk) to experience

## 1. 效果展示
## 1. Results Exhibition
<div align="center">
<img src=https://user-images.githubusercontent.com/14087480/141890516-6aad4691-9ab3-4baf-99e5-f1afa1b21281.png width="50%">
<img src=https://user-images.githubusercontent.com/14087480/141890516-6aad4691-9ab3-4baf-99e5-f1afa1b21281.png width="50%">

</div>


## 2. 安卓Demo使用说明
## 2. Android Demo Instructions

### 2.1 要求
### 2.1 Reruirements
* Android Studio 3.4;
* Android手机
* Android mobile phone

### 2.2 一键安装
* 打开Android Studio,在"Welcome to Android Studio"窗口点击"Open an existing Android Studio project",在弹出的路径选择窗口中选择本安卓demo对应的文件夹,然后点击右下角的"Open"按钮即可导入工程,构建工程的过程中会自动下载demo需要的Lite预测库;
* 通过USB连接Android手机;
* 载入工程后,点击菜单栏的Run->Run 'App'按钮,在弹出的"Select Deployment Target"窗口选择已经连接的Android设备,然后点击"OK"按钮;
### 2.2 Installation
* open Android Studio and on "Welcome to Android Studio" window, click "Open an existing Android Studio project". In the path selection window that is displayed, select the folder corresponding to the Android Demo. Then click the "Open" button in the lower right corner to import the project. The Lite prediction library required by demo will be automatically downloaded during the construction process.
* Connect Android phone via USB;
* After loading the project, click the Run->Run 'App' button on the menu bar, Select the connected Android device in the "Select Deployment Target" window, and then click the "OK" button;

*注:此安卓demo基于[Paddle-Lite](https://paddlelite.paddlepaddle.org.cn/)开发,PaddleLite版本为2.8.0*
*Note:this Android demo is based on [Paddle-Lite](https://paddlelite.paddlepaddle.org.cn/),PaddleLite version is 2.8.0*

### 2.3 预测
* 在人像抠图Demo中,默认会载入一张人像图像,并会在图像下方给出CPU的预测结果和预测时延;
* 在人像抠图Demo中,你还可以通过右上角的"打开本地相册"和"打开摄像头拍照"按钮分别从相册或相机中加载测试图像然后进行预测推理;
### 2.3 Prediction
* In human matting demo, a human image will be loaded by default, and the CPU prediction result and prediction delay will be given below the image;
* In the human matting demo, you can also load test images from the album or camera by clicking the "Open local album" and "Open camera to take photos" buttons in the upper right corner, and then perform prediction.

*注意:demo中拍照时照片会自动压缩,想测试拍照原图效果,可使用手机相机拍照后从相册中打开进行预测。*
*Note:When taking a photo in demo, the photo will be compressed automatically. If you want to test the effect of the original photo, you can use the mobile phone camera to take a photo and open it from the album for prediction.*

## 3. 二次开发
可按需要更新预测库或模型进行二次开发,其中更新模型分为模型导出和模型转换两个步骤。
## 3. Secondary Development
The inference library or model can be updated according to the need for secondary development. The updated model can be divided into two steps: model export and model transformation.

### 3.1 更新预测库
[Paddle-Lite官网](https://paddlelite.paddlepaddle.org.cn/)提供了预编译版本的安卓预测库,也可以参考官网自行编译。
### 3.1 Update Inference Library
[Paddle-Lite website](https://paddlelite.paddlepaddle.org.cn/) probides a pre-compiled version of Android inference library, which can also be compiled by referring to the official website.

Paddle-Lite在安卓端的预测库主要包括三个文件:
The Paddle-Lite inference library on Android mainly contains three files:

* PaddlePredictor.jar;
* arm64-v8a/libpaddle_lite_jni.so;
* armeabi-v7a/libpaddle_lite_jni.so;

下面分别介绍两种方法
Two methods will be introduced in the following

* 使用预编译版本的预测库,最新的预编译文件参考:[release](https://github.com/PaddlePaddle/Paddle-Lite/releases/),此demo使用的[版本](https://paddlelite-demo.bj.bcebos.com/libs/android/paddle_lite_libs_v2_8_0.tar.gz)
* Use a precompiled version of the inference library. Latest precompiled file reference:[release](https://github.com/PaddlePaddle/Paddle-Lite/releases/). This demo uses the [version](https://paddlelite-demo.bj.bcebos.com/libs/android/paddle_lite_libs_v2_8_0.tar.gz)

解压上面文件,PaddlePredictor.jar位于:java/PaddlePredictor.jar
Uncompress the above files and the PaddlePredictor.jar is in java/PaddlePredictor.jar;

arm64-v8a相关so位于:java/libs/arm64-v8a
The so file about arm64-v8a is in java/libs/arm64-v8a;

armeabi-v7a相关so位于:java/libs/armeabi-v7a
The so file about armeabi-v7a is in java/libs/armeabi-v7a;

* 手动编译Paddle-Lite预测库
开发环境的准备和编译方法参考:[Paddle-Lite源码编译](https://paddle-lite.readthedocs.io/zh/release-v2.8/source_compile/compile_env.html)
* Manually compile the paddle-Lite inference library
Development environment preparation and compilation methods refer to [paddle-Lite source code compilation](https://paddle-lite.readthedocs.io/zh/release-v2.8/source_compile/compile_env.html).

准备好上述文件,即可参考[java_api](https://paddle-lite.readthedocs.io/zh/release-v2.8/api_reference/java_api_doc.html)在安卓端进行推理。具体使用预测库的方法可参考[Paddle-Lite-Demo](https://github.com/PaddlePaddle/Paddle-Lite-Demo)中更新预测库部分的文档。
Prepare the above documents, then refer [java_api](https://paddle-lite.readthedocs.io/zh/release-v2.8/api_reference/java_api_doc.html)to have a inference on Android. Refer to the documentation in the Update Inference Library section of [Paddle-Lite-Demo](https://github.com/PaddlePaddle/Paddle-Lite-Demo) for details on how to use the inference library.

### 3.2 模型导出
此demo的人像抠图采用Backbone为HRNet_W18的MODNet模型,模型[训练教程](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/contrib/Matting)请参考官网,官网提供了3种不同性能的Backone:MobileNetV2、ResNet50_vd和HRNet_W18。本安卓demo综合考虑精度和速度要求,采用了HRNet_W18作为Backone。可以直接从官网下载训练好的动态图模型进行算法验证。
### 3.2 Model Export
This demo uses the MODNet with HRNet_W18 backbone to perform human matting. Please refer to official websit to get model [training tutorial](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/contrib/Matting). There are 3 models provided with different backbones: MobileNetV2、ResNet50_vd and HRNet_W18. This Android demo considers the accuracy and speed, using HRNet_W18 as the Backone. The trained dynamic graph model can be downloaded directly from the official website for algorithm verification.

为了能够在安卓手机上进行推理,需要将动态图模型导出为静态图模型,导出时固定图像输入尺寸即可。
In order to be able to infer on Android phones, the dynamic graph model needs to be exported as a static graph model, and the input size of the image should be fixed when exporting.

首先git最新的[PaddleSeg](https://github.com/paddlepaddle/paddleseg/tree/develop)项目,然后cd进入到PaddleSeg/contrib/Matting目录。将下载下来的modnet-hrnet_w18.pdparams动态图模型文件(也可以自行训练得到)放置在当前文件夹(PaddleSeg/contrib/Matting)下面。然后修改配置文件 configs/modnet_mobilenetv2.yml(注意:虽然采用hrnet18模型,但是该模型依赖的配置文件modnet_hrnet_w18.yml本身依赖modnet_mobilenetv2.yml),修改其中的val_dataset字段如下:
First, update the [PaddleSeg](https://github.com/paddlepaddle/paddleseg/tree/develop) repository. Then `cd` to the `PaddleSeg/contrib/Matting` directory. Then put the downloaded modnet-hrnet_w18.pdparams (traing by youself is ok) on current directory(`PaddleSeg/contrib/Matting`). After that, fix the config file `configs/modnet_mobilenetv2.yml`(note: hrnet18 is used, but the config file `modnet_hrnet_w18.yml` is based on `modnet_mobilenetv2.yml`), where,modify the val_dataset field as follows:

``` yml
val_dataset:
Expand All @@ -78,63 +80,61 @@ val_dataset:
mode: val
get_trimap: False
```
上述修改中尤其注意short_size: 256这个字段,这个值直接决定我们最终的推理图像采用的尺寸大小。这个字段值设置太小会影响预测精度,设置太大会影响手机推理速度(甚至造成手机因性能问题无法完成推理而奔溃)。经过实际测试,对于hrnet18,该字段设置为256较好。
In the above modification, pay special attention to the short_size: 256 field which directly determines the size of our final inferential image. If the value of this field is set too small, the prediction accuracy will be affected; if the value is set too high, the inference speed of the phone will be affected (or even the phone will crash due to performance problems). In practical testing, this field is set to 256 for HRnet18.

完成配置文件修改后,采用下面的命令进行静态图导出:
After modifying the configuration file, run the following command to export the static graph:
``` shell
python export.py \
--config configs/modnet/modnet_hrnet_w18.yml \
--model_path modnet-hrnet_w18.pdparams \
--save_dir output
```

转换完成后在当前目录下会生成output文件夹,该文件夹中的文件即为转出来的静态图文件。
After the conversion, the `output` folder will be generated in the current directory, and the files in the folder are the static graph files.

### 3.3 模型转换
### 3.3 Model Conversion

#### 3.3.1 模型转换工具
准备好PaddleSeg导出来的静态图模型和参数文件后,需要使用Paddle-Lite提供的opt对模型进行优化,并转换成Paddle-Lite支持的文件格式。
#### 3.3.1 Model Conversion Tool
Once you have the static diagram model and parameter files exported from PaddleSeg ready, you need to optimize the model using the opt provided with Paddle-Lite and convert to the file format supported by Paddle-Lite.

首先安装PaddleLite:
Firstly, install PaddleLite:

``` shell
pip install paddlelite==2.8.0
```

然后使用下面的python脚本进行转换:
Then use the following Python script to convert:

``` python
# 引用Paddlelite预测库
# Reference the Paddlelite inference library
from paddlelite.lite import *

# 1. 创建opt实例
# 1. Create opt instance
opt=Opt()

# 2. 指定静态模型路径
# 2. Specify the static model path
opt.set_model_file('./output/model.pdmodel')
opt.set_param_file('./output/model.pdiparams')

# 3. 指定转化类型: armx86openclnpu
# 3. Specify conversion type: arm, x86, opencl or npu
opt.set_valid_places("arm")
# 4. 指定模型转化类型: naive_bufferprotobuf
# 4. Specifies the model transformation type: naive_buffer or protobuf
opt.set_model_type("naive_buffer")
# 5. 输出模型地址
# 5. Address of output model
opt.set_optimize_out("./output/hrnet_w18")
# 6. 执行模型优化
# 6. Perform model optimization
opt.run()
```

转换完成后在output目录下会生成对应的hrnet_w18.nb文件。
After conversion, the `hrnet_w18.nb` file will be generated in the `output` directory.

#### 3.3.2 更新模型
将优化好的`.nb`文件,替换安卓程序中的 app/src/main/assets/image_matting/
models/modnet下面的文件即可。
#### 3.3.2 Update Model
Using the optimized `. Nb ` file to replace the file in `app/SRC/main/assets/image_matting/models/modnet` in android applications.

然后在工程中修改图像输入尺寸:打开string.xml文件,修改示例如下:
Then change the image input size in the project: open the string.xml file and follow the under example:
``` xml
<string name="INPUT_SHAPE_DEFAULT">1,3,256,256</string>
```
1,3,256,256分别表示图像对应的batchsize、channel、height、width,我们一般修改height和width即可,这里的height和width需要和静态图导出时设置的尺寸一致。

整个安卓demo采用java实现,没有内嵌C++代码,构建和执行比较简单。未来也可以将本demo移植到java web项目中实现web版人像抠图。
1,3,256,256 represent the corresponding batchsize, channel, height and width respectively. Generally, height and width are modified to the size which set during model export.

The entire android demo is implemented in Java, without embedded C++ code, which is relatively easy to build and execute. In the future, you can also move this demo to Java Web projects for human matting in the Web.
Loading