Coder Social home page Coder Social logo

xiaochengcike / seesawfacenet_pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cvtower/seesawfacenet_pytorch

0.0 2.0 0.0 14.83 MB

offical seesawfacenet pytorch implement, https://arxiv.org/abs/1908.09124

Python 2.12% Jupyter Notebook 97.88%

seesawfacenet_pytorch's Introduction

offical pytorch implement of seesawfacenet


1. Intro

  • This repo is a reimplementation of seesawfacenet(paper)
  • For models, including the pytorch implementation of the backbone modules of Arcface/MobileFacenet/seesawfacenet(including seesaw_shareFaceNet,seesaw_shuffleFaceNet, DW_seesawFaceNetv1, DW_seesawFaceNetv2)
  • We build build this repo based on the work of @TreB1eN(https://github.com/TreB1eN/InsightFace_Pytorch), and fixed few bugs before usage.
  • Pretrained models are posted, include the MobileFacenet in the original paper

2. Pretrained Models & training logs & Performance

seesawfacenet @ googledrive seesawfacenet @ baidudisk extraction code:exiy Image text Image text

3. How to use

  • clone

    git clone https://github.com/TropComplique/mtcnn-pytorch.git
    

3.1 Data Preparation

3.1.1 Prepare Facebank (For testing over camera or video)

Provide the face images your want to detect in the data/face_bank folder, and guarantee it have a structure like following:

data/facebank/
        ---> id1/
            ---> id1_1.jpg
        ---> id2/
            ---> id2_1.jpg
        ---> id3/
            ---> id3_1.jpg
           ---> id3_2.jpg

3.1.2 download the pretrained model to work_space/model

If more than 1 image appears in one folder, an average embedding will be calculated

3.2.3 Prepare Dataset (MS1MV2(face_emore, refined MS1M...whatever we call it) For training refer to the original paper)

download the MS1MV2 dataset:

Note: If you use MS1MV2 dataset and the cropped VGG2 dataset, please cite the original papers.

  • after unzip the files to 'data' path, run :

    python prepare_data.py
    

    after the execution, you should find following structure:

faces_emore/
            ---> agedb_30
            ---> calfw
            ---> cfp_ff
            --->  cfp_fp
            ---> cfp_fp
            ---> cplfw
            --->imgs
            ---> lfw
            ---> vgg2_fp

3.2 detect over camera:

    1. download the desired weights to model folder:
  • 2 to take a picture, run

    python take_pic.py -n name
    

    press q to take a picture, it will only capture 1 highest possibility face if more than 1 person appear in the camera

  • 3 or you can put any preexisting photo into the facebank directory, the file structure is as following:

- facebank/
         name1/
             photo1.jpg
             photo2.jpg
             ...
         name2/
             photo1.jpg
             photo2.jpg
             ...
         .....
    if more than 1 image appears in the directory, average embedding will be calculated
  • 4 to start

    python face_verify.py 
    

3.3 detect over video:

​```
python infer_on_video.py -f [video file name] -s [save file name]
​```

the video file should be inside the data/face_bank folder

previous work on mtcnn for android platform and face cropping

3.4 Training:

​```
python train.py -b [batch_size] -lr [learning rate] -e [epochs]

# python train.py -net mobilefacenet -b 256 -w 24
​```

4. References

PS

Citation

Please cite our papers in your publications if it helps your research:

@misc{zhang2019seesawnet, title={Seesaw-Net: Convolution Neural Network With Uneven Group Convolution}, author={Jintao Zhang}, year={2019}, eprint={1905.03672}, archivePrefix={arXiv}, primaryClass={cs.CV} }

@misc{zhang2019seesawfacenets, title={SeesawFaceNets: sparse and robust face verification model for mobile platform}, author={Jintao Zhang}, year={2019}, eprint={1908.09124}, archivePrefix={arXiv}, primaryClass={cs.CV} }

seesawfacenet_pytorch's People

Contributors

cvtower avatar dependabot[bot] avatar

Watchers

 avatar  avatar

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.