Giter Site home page Giter Site logo

max4bang / virface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sandwichfish/virface

0.0 0.0 0.0 3.46 MB

This is a PyTorch implementation of "VirFace: Enhancing Face Recognition via Unlabeled Shallow Data" (CVPR 2021).

License: MIT License

Python 100.00%

virface's Introduction

VirFace

This is a PyTorch implementation of "VirFace: Enhancing Face Recognition via Unlabeled Shallow Data" (CVPR 2021). VirFace_Framework.png

Training stage

Training Stage Datasets args.method pretrain model needed
Pre-train backbone Label pretrain None
Pre-train generator Label generator backbone, head
Training VirClass Label & Unlabel virclass backbone, head
Training VirFace Label & Unlabel virface backbone, head, generator

Backbone model

Arch ResNet User Arch
18 34 50 101 152
args.arch resnet18 resnet34 resnet50 resnet101 resnet152 usr
- How to use **user modified architecture**:
  • edit config.py: import modified '.py' file, then modifiy "model_usr=None" to "model_usr=%filename.%modelname(%params)"
  • Note: the user modified architecture should not contain any classification FC layer(e.g. the last FC layer in ArcFace). The output should be an embedding feature.

Usage

  • Pretrain
   python3 train.py --method pretrain
   python3 train.py --method generator --pretrain_file %backbone_path

Note: 'pretrain' means training backbone(contraining head params) and save [backbone, head] model; 'generator' means training generator and save [backbone, head, generator] models.

  • Training from scrach

    • VirClass
       python3 train.py --method pretrain
       python3 train.py --method virclass --pretrain_file %backbone_path
    • VirFace
       python3 train.py --method pretrain
       python3 train.py --method generator --pretrain_file %backbone_path
       python3 train.py --method virface --pretrain_file %generator_path
  • Training from pretrained model

    • VirClass
       python3 train.py --method virclass --pretrain_file %backbone_path
    • VirFace
       python3 train.py --method virface --pretrain_file %generator_path

    Note: this pretrained file should contain [backbone, head, generator]

  • Arguments setting

    method: choose training stage. [pretrain, generator, virclass, virface]

    label_batch_size: label data batch size.

    unlabel_batch_size: unlabel data batch size.

    arch: choose architecture of backbone. [resnet18, resnet34, resnet50, resnet101, resnet152, usr]

    feat_len: length of embedding feature.

    num_ids: number of identities in labeled dataset.

    gen_num: the number of generated features via generator.

    KL: weight of KL loss.

    L2: weight of MSE loss.

    resume: resume flag.

    resume_file: resume checkpoint path.

    pretrained_file: pretrained checkpoint path. This is necessary if method is not "pretrain".

    tensorboard: use tensorboard or not.

    snapshot_prefix: path to save checkpoint.

    eval: whether evaluate for each epoch on LFW, CFP-FF, CFP-FP

Citation

If our paper helps your research, please cite it in your publications:

@inproceedings{li2021virface,
  title={VirFace: Enhancing Face Recognition via Unlabeled Shallow Data},
  author={Li, Wenyu and Guo, Tianchu and Li, Pengyu and Chen, Binghui and Wang, Biao and Zuo, Wangmeng and Zhang, Lei},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={14729--14738},
  year={2021}
}

virface's People

Contributors

sandwichfish 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.