forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add FaceViT
- Loading branch information
Showing
4 changed files
with
699 additions
and
3 deletions.
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
...n/FaceViT_tiny_patch9_112_WebFace42M_ArcFace_0.3_droppath005_mask0_1n8c_dp_mp_fp16o2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# global configs | ||
Global: | ||
task_type: recognition | ||
train_epoch_func: defualt_train_one_epoch | ||
eval_func: face_verification_eval | ||
checkpoint: null | ||
pretrained_model: null | ||
output_dir: ./output/ | ||
device: gpu | ||
save_interval: 1 | ||
max_num_latest_checkpoint: 0 | ||
eval_during_train: True | ||
eval_interval: 4000 | ||
eval_unit: "step" | ||
accum_steps: 1 | ||
epochs: 40 | ||
print_batch_step: 200 | ||
use_visualdl: True | ||
seed: 2022 | ||
|
||
# FP16 setting | ||
FP16: | ||
level: O2 | ||
GradScaler: | ||
init_loss_scaling: 27648.0 | ||
# no_unscale_list: ['dist'] | ||
|
||
DistributedStrategy: | ||
data_parallel: True | ||
|
||
# model architecture | ||
Model: | ||
name: FaceViT_tiny_patch9_112 | ||
num_features : 512 | ||
class_num: 2059906 | ||
pfc_config: | ||
sample_ratio: 0.3 | ||
model_parallel: True | ||
sparse_update: False | ||
|
||
# loss function config for traing/eval process | ||
Loss: | ||
Train: | ||
- MarginLoss: | ||
m1: 1.0 | ||
m2: 0.0 | ||
m3: 0.4 | ||
s: 64.0 | ||
model_parallel: True | ||
weight: 1.0 | ||
|
||
LRScheduler: | ||
name: Poly | ||
learning_rate: 0.001 | ||
decay_unit: step | ||
warmup_epochs: 4 | ||
warmup_end_lr: 0.001 | ||
|
||
Optimizer: | ||
name: AdamW | ||
betas: (0.9, 0.999) | ||
epsilon: 1e-8 | ||
weight_decay: 0.1 | ||
use_master_param: False | ||
exp_avg_force_fp32: True | ||
no_weight_decay_name: ["pos_embed", "norm"] | ||
grad_clip: | ||
name: ClipGradByGlobalNorm | ||
clip_norm: 5.0 | ||
no_clip_list: ['dist'] | ||
|
||
|
||
# data loader for train and eval | ||
DataLoader: | ||
Train: | ||
dataset: | ||
name: FaceIdentificationDataset | ||
image_root: ./dataset/WebFace42M | ||
cls_label_path: ./dataset/WebFace42M/label.txt | ||
transform_ops: | ||
- DecodeImage: | ||
to_rgb: True | ||
channel_first: False | ||
- RandFlipImage: | ||
flip_code: 1 | ||
- NormalizeImage: | ||
scale: 1.0/255.0 | ||
mean: [0.5, 0.5, 0.5] | ||
std: [0.5, 0.5, 0.5] | ||
order: '' | ||
- ToCHWImage: | ||
sampler: | ||
name: DistributedBatchSampler | ||
batch_size: 512 | ||
drop_last: False | ||
shuffle: True | ||
loader: | ||
num_workers: 8 | ||
use_shared_memory: True | ||
|
||
Eval: | ||
dataset: | ||
name: FaceVerificationDataset | ||
image_root: ./dataset/WebFace42M/agedb_30 | ||
cls_label_path: ./dataset/WebFace42M/agedb_30/label.txt | ||
transform_ops: | ||
- DecodeImage: | ||
to_rgb: True | ||
channel_first: False | ||
- NormalizeImage: | ||
scale: 1.0/255.0 | ||
mean: [0.5, 0.5, 0.5] | ||
std: [0.5, 0.5, 0.5] | ||
order: '' | ||
- ToCHWImage: | ||
sampler: | ||
name: BatchSampler | ||
batch_size: 128 | ||
drop_last: False | ||
shuffle: False | ||
loader: | ||
num_workers: 0 | ||
use_shared_memory: True | ||
|
||
Metric: | ||
Eval: | ||
- LFWAcc: | ||
flip_test: True | ||
|
||
Export: | ||
export_type: onnx | ||
input_shape: [None, 3, 112, 112] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.