architecture: BlazeFace
max_iters: 320000
train_feed: SSDTrainFeed
eval_feed: SSDEvalFeed
test_feed: SSDTestFeed
pretrain_weights: 
use_gpu: true
snapshot_iter: 10000
log_smooth_window: 20
log_iter: 20
metric: WIDERFACE
save_dir: output
weights: output/blazeface_nas/model_final/
# 1(label_class) + 1(background)
num_classes: 2

BlazeFace:
  backbone: BlazeNet
  output_decoder:
    keep_top_k: 750
    nms_threshold: 0.3
    nms_top_k: 5000
    score_threshold: 0.01
  min_sizes: [[16.,24.], [32., 48., 64., 80., 96., 128.]]
  use_density_prior_box: false

BlazeNet:
  blaze_filters: [[12, 12], [12, 12, 2], [12, 12]]
  double_blaze_filters: [[12, 16, 24, 2], [24, 12, 24], [24, 16, 72, 2], [72, 12, 72]]
  with_extra_blocks: true
  lite_edition: false

LearningRate:
  base_lr: 0.001
  schedulers:
  - !PiecewiseDecay
    gamma: 0.1
    milestones: [240000, 300000]

OptimizerBuilder:
  optimizer:
    momentum: 0.0
    type: RMSPropOptimizer
  regularizer:
    factor: 0.0005
    type: L2

SSDTrainFeed:
  batch_size: 8
  use_process: True
  dataset:
    dataset_dir: dataset/wider_face
    annotation: wider_face_split/wider_face_train_bbx_gt.txt
    image_dir: WIDER_train/images
  image_shape: [3, 640, 640]
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_mixup: false
  - !NormalizeBox {}
  - !RandomDistort
    brightness_lower: 0.875
    brightness_upper: 1.125
    is_order: true
  - !ExpandImage
    max_ratio: 4
    prob: 0.5
  - !CropImageWithDataAchorSampling
    anchor_sampler:
    - [1, 10, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.2, 0.0]
    batch_sampler:
    - [1, 50, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0]
    - [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0]
    - [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0]
    - [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0]
    - [1, 50, 0.3, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0]
    target_size: 640
  - !RandomInterpImage
    target_size: 640
  - !RandomFlipImage
    is_normalized: true
  - !Permute {}
  - !NormalizeImage
    is_scale: false
    mean: [104, 117, 123]
    std: [127.502231, 127.502231, 127.502231]

SSDEvalFeed:
  batch_size: 1
  use_process: false
  fields: ['image', 'im_id', 'gt_box']
  dataset:
    dataset_dir: dataset/wider_face
    annotation: wider_face_split/wider_face_val_bbx_gt.txt
    image_dir: WIDER_val/images
  drop_last: false
  image_shape: [3, 640, 640]
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_mixup: false
  - !NormalizeBox {}
  - !ResizeImage
    interp: 1
    target_size: 640
    use_cv2: false
  - !Permute {}
  - !NormalizeImage
    is_scale: false
    mean: [104, 117, 123]
    std: [127.502231, 127.502231, 127.502231]

SSDTestFeed:
  batch_size: 1
  use_process: false
  dataset:
    use_default_label: true
  drop_last: false
  image_shape: [3, 640, 640]
  sample_transforms:
  - !DecodeImage
    to_rgb: true
    with_mixup: false
  - !ResizeImage
    interp: 1
    target_size: 640
    use_cv2: false
  - !Permute {}
  - !NormalizeImage
    is_scale: false
    mean: [104, 117, 123]
    std: [127.502231, 127.502231, 127.502231]
