资源算法resnet-face-pytorch

resnet-face-pytorch

2020-02-21 | |  35 |   0 |   0

This repository shows how to train ResNet models in PyTorch on publicly available face recognition datasets.

Setup

  • Install Anaconda if not already installed in the system.

  • Create an Anaconda environment: conda create -n resnet-face python=2.7 and activate it: source activate resnet-face.

  • Install PyTorch and TorchVision inside the Anaconda environment. First add a channel to conda: conda config --add channels soumith. Then install: conda install pytorch torchvision cuda80 -c soumith.

  • Install the dependencies using conda: conda install scipy Pillow tqdm scikit-learn scikit-image numpy matplotlib ipython pyyaml.

  • Notes:

    • Multiple GPUs (we used 5 GeForce GTX 1080Ti in parallel) recommended for the training to finish in reasonable time.

    • Tested on server running CentOS

    • Using PyTorch

    • Optional - an explanatory blogpost on Deep Residual Networks (ResNets) structure.

Contents

PyTorch ResNet on UMD-Face

Demo to train a ResNet-50 model on the UMDFaces dataset.

Dataset preparation

  • Download the UMDFaces dataset (the 3 batches of still images), which contains 367,888 face annotations for 8,277 subjects, split into 3 batches.

  • The images need to be cropped into 'train' and 'val' folders. Since the UMDFaces dataset does not specify training and validation sets, by default we select two images from every subject for validation.

  • The cropping code is in the Python script umd-face/run_crop_face.py. It takes the following command-line arguments:

    • --dataset_path (-d)

    • --output_path (-o)

    • --batch (-b)

  • The following shell command does the cropping for each batch in parallel, using default dataset_path and output_pathfor i in {0..2}; python umd-face/run_crop_face -b $i &; done.

上一篇:YOLO_ResNet

下一篇: tf_resnet_cifar

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...