Coder Social home page Coder Social logo

damofd's Introduction

Introduction

DamoFD introduces a novel DDSAR-score to characterize backbone stage-level detection ability, based on which and SCRFD detection framework, a sota family-based backboen architectures are searched automatically. Now, our paper is accepted by ICLR-2023.

Quickly Start on EasyFace

Performance

Precision, flops are both evaluated on VGA resolution. DamoFD性能

Installation

Please refer to mmdetection for installation.

  1. Install mmcv. (mmcv-full==1.2.6 and 1.3.3 was tested)
  2. Install build requirements and then install mmdet.
    pip install -r requirements/build.txt
    pip install -v -e .  # or "python setup.py develop"
    

Data preparation

WIDERFace:

  1. Download WIDERFace datasets and put it under data/retinaface.
  2. Download annotation files from gdrive and put them under data/retinaface/
  data/retinaface/
      train/
          images/
          labelv2.txt
      val/
          images/
          labelv2.txt
          gt/
              *.mat
          

Annotation Format

please refer to labelv2.txt for detail

For each image:

# <image_path> image_width image_height
bbox_x1 bbox_y1 bbox_x2 bbox_y2 (<keypoint,3>*N)
...
...
# <image_path> image_width image_height
bbox_x1 bbox_y1 bbox_x2 bbox_y2 (<keypoint,3>*N)
...
...

Keypoints can be ignored if there is bbox annotation only.

Training

Example training command, with 4 GPUs:

CUDA_VISIBLE_DEVICES="0,1,2,3" PORT=29701 bash ./tools/dist_train.sh ./configs/DamoFD/DamoFD_0.5g.py 4

WIDERFace Evaluation

We use a pure python evaluation script without Matlab.

GPU=0
GROUP=scrfd
TASK=scrfd_2.5g
CUDA_VISIBLE_DEVICES="$GPU" python -u tools/test_widerface.py ./configs/"$GROUP"/"$TASK".py ./work_dirs/"$TASK"/model.pth --mode 0 --out wouts

Pretrained-Models

Name Easy Medium Hard FLOPs Params(M) Link
DamoFD_0.5G 90.32 88.36 71.03 520M 0.26 download
DamoFD_2.5G 92.82 91.48 78.70 2.46G 0.44 download
DamoFD_10G 95.14 94.29 84.07 9.74G 1.27 download
DamoFD_34G 95.63 94.80 85.08 34.03G 6.24 download
DamoFD_0.5G_KPS 90.41 88.45 69.97 593M 0.27 EasyFace
DamoFD_2.5G_KPS 93.25 91.85 78.17 2.53G 0.45 EasyFace
DamoFD_10G_KPS 95.42 94.35 83.94 9.83G 1.28 EasyFace
DamoFD_34G_KPS 95.96 95.08 86.09 34.32G 6.28 EasyFace

mAP, FLOPs are all evaluated on VGA resolution. _KPS means the model includes 5 keypoints prediction.

Convert to ONNX

Please refer to tools/scrfd2onnx.py

Generated onnx model can accept dynamic input as default.

You can also set specific input shape by pass --shape 640 640, then output onnx model can be optimized by onnx-simplifier.

Inference

Please refer to tools/scrfd.py which uses onnxruntime to do inference.

Network Search

cd DDSAR
sh scripts/DamoFd_500M.sh

As mentioned in paper, we set α to 0.25 when searching DDSAR-500M models. While for DDSAR-2.5G, DDSAR-10G and DDSAR-34G models, we need to find a suitable value of α and add some constraints into search space. Otherwise, some trivial architectures may be searched.

Acknowledgments

We thank Insighface for the excellent code base.

damofd's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.