• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Using Pytorch to implement a ResNet50 for Cross-Age Face Recognition

ResNet-Pytorch-Face-Recognition

Using Pytorch to implement a ResNet50 for Cross-Age Face Recognition
Generally speaking, Pytorch is much more user-friendly than Tensorflow for academic purpose.

Prepare Dataset and Environment

Trainable ResNet50 using Python3.5 + Pytorch
DataSet: Cross-Age Celebrity Dataset(CACD)
By default, you should put all the CACD images under "./CACD2000/". If your dataset is in another place, add "--root-path your_path" when you run main.py.
You don't need to crop image into 2242243 size anymore, pytorchvision provide convenient "transforms" to do so.

Explanation of Each File

  1. main.py is just used to control parameters, it doesn't contains any useful details.
  2. ResNet.py & VGG.py are the cores of the project, they have the implementation of Networks.
  3. train.py contains the details of training process.
  4. data.py maintains a Class to generate CACD data class, which is very different with Tensorflow and quite useful.
  5. In /model/params.pkl, we give a pretrained model learnt through default setting (change number of epoch to 30)

Training Part

  1. Run main.py directly, there are some options and parameters you can modify, pleace check the details of main.py.
  2. About "--model", there are 3 options: resnet50, resnet101, vgg16. Although I also implemented VGG class, but I didn't check whether it's working or not, so the default option is resnet50.
  3. Labels and Image names are loaded from "./data/label.npy" and "./data/name.npy".
    Pytorch provide a very useful approach to create datasets. Please check data.py
  4. Label is range from [1, LABELSNUM], to make correct classification, we should change it to [0, LABELNUM-1]
  5. If you want to load a existing model, you should run the following "python main.py --model-path your_path --pretrained 1".

Evaluation

Since I just want to get used to Pytorch. I didn't prepare a evaluation method, you can make your own if you like.

More Repositories

1

Scene-Graph-Benchmark.pytorch

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper โ€œUnbiased Scene Graph Generation from Biased Training CVPR 2020โ€
Jupyter Notebook
1,049
star
2

Long-Tailed-Recognition.pytorch

[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS). It is also a PyTorch implementation of the NeurIPS 2020 paper 'Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal Effect'.
Jupyter Notebook
560
star
3

VQA2.0-Recent-Approachs-2018.pytorch

A pytroch reimplementation of "Bilinear Attention Network", "Intra- and Inter-modality Attention", "Learning Conditioned Graph Structures", "Learning to count object", "Bottom-up top-down" for Visual Question Answering 2.0
Python
292
star
4

VCTree-Scene-Graph-Generation

Code for the Scene Graph Generation part of CVPR 2019 oral paper: "Learning to Compose Dynamic Tree Structures for Visual Contexts"
Python
119
star
5

Generalized-Long-Tailed-Benchmarks.pytorch

[ECCV 2022] A generalized long-tailed challenge that incorporates both the conventional class-wise imbalance and the overlooked attribute-wise imbalance within each class. The proposed IFL together with other baselines are also included.
Jupyter Notebook
114
star
6

GGNN-for-bAbI-dataset.pytorch.1.0

A Complete PyTorch 1.0 Implementation of Gated Graph Sequence Neural Networks (GGNN)
Python
53
star
7

ResNet50-Tensorflow-Face-Recognition

Using Tensorflow to implement a ResNet50 for Cross-Age Face Recognition
Python
45
star
8

VCTree-Visual-Question-Answering

Code for the Visual Question Answering (VQA) part of CVPR 2019 oral paper: "Learning to Compose Dynamic Tree Structures for Visual Contexts"
Python
35
star
9

Local-Disco-Diffusion-v5.2.jupyterNote

A custom Disco Diffusion v5.2 that runs on local GPUS.
Jupyter Notebook
23
star
10

CiiV-Adversarial-Robustness.pytorch

The official PyTorch Implementation of the Paper "Adversarial Visual Robustness by Causal Intervention"
Jupyter Notebook
18
star
11

LVIS-for-mmdetection

support Large Vocabulary Instance Segmentation (LVIS) dataset for mmdetection
Python
16
star
12

Kinetics-Data-Preprocessing

An instruction to 1) download the Kinetics-400/Kinetics-600, 2) resize the videos, and 3) prepare annotations.
Python
9
star
13

Qwen-Tokenizer-Pruner

Due to the huge vocaburary size (151,936) of Qwen models, the Embedding and LM Head weights are excessively heavy. Therefore, this project provides a Tokenizer vocabulary shearing solution for Qwen and Qwen-VL.
Python
7
star
14

Describe-and-Guess-GAME-Using-GPT-3

A simple demo of how to use GPT-3 to play Describe-and-Guess in the specified topic and question type.
Python
6
star
15

kai-blog

SCSS
1
star
16

faster-rcnn.pytorch

Python
1
star
17

Minimalist-TinyLLaMA-to-Onnx

Export TinyLLaMA to Onnx and Conduct LLM inference using onnxruntime
Python
1
star
18

Quick-Draw-Multimodal-Recognition

The Course Project of CE7454 (Team 13)
Jupyter Notebook
1
star