Skip to content

Commit

Permalink
[Feature] pp-humanseg-v2 (#2331)
Browse files Browse the repository at this point in the history
* refine code and doc
* clean files
* rename all models
* english doc
  • Loading branch information
juncaipeng authored Jul 20, 2022
1 parent 69aa037 commit 0fe23dc
Show file tree
Hide file tree
Showing 35 changed files with 1,957 additions and 1,688 deletions.
476 changes: 294 additions & 182 deletions contrib/PP-HumanSeg/README.md

Large diffs are not rendered by default.

471 changes: 289 additions & 182 deletions contrib/PP-HumanSeg/README_cn.md

Large diffs are not rendered by default.

247 changes: 0 additions & 247 deletions contrib/PP-HumanSeg/bg_replace.py

This file was deleted.

66 changes: 66 additions & 0 deletions contrib/PP-HumanSeg/configs/human_pp_humansegv1_lite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
batch_size: 8
iters: 1000

train_dataset:
type: Dataset
dataset_root: data/mini_supervisely
train_path: data/mini_supervisely/train.txt
num_classes: 2
transforms:
- type: Resize
target_size: [192, 192]
- type: ResizeStepScaling
scale_step_size: 0
- type: RandomRotation
- type: RandomPaddingCrop
crop_size: [192, 192]
- type: RandomHorizontalFlip
- type: RandomDistort
- type: RandomBlur
prob: 0.3
- type: Normalize
mode: train

val_dataset:
type: Dataset
dataset_root: data/mini_supervisely
val_path: data/mini_supervisely/val.txt
num_classes: 2
transforms:
- type: Resize
target_size: [192, 192]
- type: Normalize
mode: val

export:
transforms:
- type: Resize
target_size: [192, 192]
- type: Normalize


optimizer:
type: sgd
momentum: 0.9
weight_decay: 0.0005

lr_scheduler:
type: PolynomialDecay
learning_rate: 0.0001
end_lr: 0
power: 0.9

loss:
types:
- type: MixedLoss
losses:
- type: CrossEntropyLoss
- type: LovaszSoftmaxLoss
coef: [0.8, 0.2]
coef: [1]

model:
type: PPHumanSegLite
align_corners: False
num_classes: 2
pretrained: pretrained_models/human_pp_humanseg_lite_v1_192x192_pretrained/model.pdparams
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
batch_size: 64
iters: 2000
batch_size: 8
iters: 1000

train_dataset:
type: Dataset
Expand All @@ -9,11 +9,15 @@ train_dataset:
transforms:
- type: Resize
target_size: [192, 192]
- type: ResizeStepScaling
scale_step_size: 0
- type: RandomRotation
- type: RandomPaddingCrop
crop_size: [192, 192]
- type: RandomHorizontalFlip
- type: RandomDistort
brightness_range: 0.4
contrast_range: 0.4
saturation_range: 0.4
- type: RandomBlur
prob: 0.3
- type: Normalize
mode: train

Expand Down Expand Up @@ -42,13 +46,17 @@ optimizer:

lr_scheduler:
type: PolynomialDecay
learning_rate: 0.05
learning_rate: 0.001
end_lr: 0
power: 0.9

loss:
types:
- type: CrossEntropyLoss
- type: MixedLoss
losses:
- type: CrossEntropyLoss
- type: LovaszSoftmaxLoss
coef: [0.8, 0.2]
coef: [1]

model:
Expand All @@ -57,5 +65,5 @@ model:
type: HRNet_W18_Small_V1
align_corners: False
num_classes: 2
pretrained: pretrained_model/fcn_hrnetw18_small_v1_humanseg_192x192/model.pdparams
backbone_indices: [-1]
pretrained: pretrained_models/human_pp_humanseg_mobile_v1_192x192_pretrained/model.pdparams
Loading

0 comments on commit 0fe23dc

Please sign in to comment.