PP-HumanSegV1
Model description
Human segmentation is a high-frequency application in the field of image segmentation.
Generally, human segmentation can be classified as portrait segmentation and general human segmentation.
For portrait segmentation and general human segmentation, PaddleSeg releases the PP-HumanSeg models, which have good performance in accuracy, inference speed, and robustness. Besides, we can deploy PP-HumanSeg models to products without training
Besides, PP-HumanSeg models can be deployed to products at zero cost, and it also supports fine-tuning to achieve better performance.
The following are demonstration videos (due to the video being large, the loading will be slightly slow). We provide full-process application guides from training to deployment, as well as video streaming segmentation and background replacement tutorials. Based on Paddle.js, you can experience the effects of Portrait Snapshot, Video Background Replacement and Barrage Penetration.
PP-HumanSegV1-Lite portrait segmentation model: It has good performance in accuracy and model size and the model architecture in url.
Step 1: Installation
git clone -b develop https://github.com/PaddlePaddle/PaddleSeg.git
cd PaddleSeg
pip3 install -r requirements.txt
pip3 install protobuf==3.20.3
pip3 install urllib3==1.26.6
yum install mesa-libGL
python3 setup.py develop
Step 2: Preparing datasets
Go to visit PP-HumanSeg14K official website, then download the PP-HumanSeg14K dataset, or you can download via Baidu Netdisk password: vui7 , Google Cloud Disk
The dataset path structure should look like:
PP-HumanSeg14K/
├── annotations
│ ├── train
│ └── val
└── images
│ ├── train
│ └── val
│ └── test
└──train.txt
└──val.txt
└──test.txt
└──LICENSE
└──README.txt
Step 3: Training
# Change ./contrib/PP-HumanSeg/configs/portrait_pp_humansegv1_lite.yml dataset path as your dataset path
# One GPU
CUDA_VISIBLE_DEVICES=0 python3 tools/train.py --config contrib/PP-HumanSeg/configs/portrait_pp_humansegv1_lite.yml --save_dir output/human_pp_humansegv1_lite --save_interval 500 --do_eval --use_vdl
# Eight GPUs
python3 -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py \
--config contrib/PP-HumanSeg/configs/portrait_pp_humansegv1_lite.yml \
--do_eval \
--use_vdl \
--save_interval 500
Results
GPUS |
mIoU |
Acc |
Kappa |
Dice |
FPS |
BI-V100 x8 |
0.9591 |
0.9836 |
0.9581 |
0.9790 |
24.54 |
Reference