VGGFace2-HQ - A high resolution face dataset for face editing purpose

Overview

VGGFace2-HQ

The first open source high resolution dataset for face swapping!!!

A high resolution version of VGGFace2 for academic face editing purpose.This project uses GFPGAN for image restoration and insightface for data preprocessing (crop and align).

logo

We provide a download link for users to download the data, and also provide guidance on how to generate the VGGFace2 dataset from scratch.

If you find this project useful, please star it. It is the greatest appreciation of our work.

Get the VGGFace2-HQ dataset from cloud!

We have uploaded the dataset of VGGFace2 HQ to the cloud, and you can download it from the cloud.

[Baidu Drive] Password: sjtu

Google Drive is coming, it will take a while to upload all the files to Google Drive.

Generate the HQ dataset by yourself. (If you want to do so)

Preparation

Installation

We highly recommand that you use Anaconda for Installation

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch
pip install insightface==0.2.1 onnxruntime
(optional) pip install onnxruntime-gpu==1.2.0

pip install basicsr
pip install facexlib
pip install -r requirements.txt
python setup.py develop
  • The pytorch and cuda versions above are most recommanded. They may vary.
  • Using insightface with different versions is not recommanded. Please use this specific version.
  • These settings are tested valid on both Windows and Ununtu.

Pretrained model

  • We use the face detection and alignment methods from insightface for image preprocessing. Please download the relative files and unzip them to ./insightface_func/models from this link.
  • Download GFPGANCleanv1-NoCE-C2.pth from GFPGAN offical repo. Place "GFPGANCleanv1-NoCE-C2.pth" in ./experiments/pretrained_models.

Data preparation

Inference

  • Frist, perform data preprocessing on all photos in VGGFACE2, that is, detect faces and align them to the same alignment format as FFHQdataset.
python scripts/crop_align_vggface2_FFHQalign.py --input_dir $DATAPATH$/VGGface2/train --output_dir_ffhqalign $ALIGN_OUTDIR$ --mode ffhq --crop_size 256
  • And then, do the magic of image restoration with GFPGAN for processed photos.
python scripts/inference_gfpgan_forvggface2.py --input_path $ALIGN_OUTDIR$  --batchSize 8 --save_dir $HQ_OUTDIR$

Acknowledgements

Comments
  • Could not load library cudnn_ops_infer64_8.dll

    Could not load library cudnn_ops_infer64_8.dll

    Hi,

    Command: python scripts/crop_align_vggface2_FFHQalign.py --input_dir /in --output_dir_ffhqalign /out --mode ffhq --crop_size 256

    Gives error: Could not load library cudnn_ops_infer64_8.dll. Error code 126 Please make sure cudnn_ops_infer64_8.dll is in your library path!

    cudnn_ops_infer64_8.dll is definitely there. I cloned my SimSwap environment, then "pip install"ed the extra requirements.

    Any idea why this does not work?

    opened by bmc84 8
  • the zip file in baidu is broken?

    the zip file in baidu is broken?

    Hi, I cannot unzip the zip files in Ubuntu 20.04, the file size seems OK, but got a lot of errors (only one image file is correctly extracted):

    unzip VGGface2_HQ.zip
    file #117124:  bad zipfile offset (local header sig):  9635728212
    
    file VGGface2_HQ.zip
    VGGface2_HQ.zip: DOS executable (COM, 0x8C-variant)
    
    $ md5sum VGG*
    b0b85056138ec65b545e8d43c17a1a4f  VGGface2_HQ.z01
    9d0f8f07f5cda2ac7c32248ba54d220a  VGGface2_HQ.z02
    f98596d310007c87fe45d2b1371aae24  VGGface2_HQ.z03
    f025c8d036c027eb4ee5af173965d85f  VGGface2_HQ.z04
    e5693cb420a648eb4630b4740f427c42  VGGface2_HQ.zip
    
    
    opened by threefoldo 2
  • How do we uncompress the files to see the data?

    How do we uncompress the files to see the data?

    This looks like an interesting dateset, but I am not sure how to open these files given their non-standard naming convention. I'm also not sure why one of them is a zip, while the others are not.

    On Linux, could you go through the commands needed to open the files and organize them into the same file structure as the original VGGFace2?

    /VGGFace2-HQ/VGGface2_HQ.zip
    /VGGFace2-HQ/VGGface2_HQ.z01
    /VGGFace2-HQ/VGGface2_HQ.z02
    /VGGFace2-HQ/VGGface2_HQ.z03
    /VGGFace2-HQ/VGGface2_HQ.z04
    

    Thank you for your help.

    opened by jhkonan 0
  • Unable to extract VGGFace2-HQ zip file

    Unable to extract VGGFace2-HQ zip file

    Hi,

    Thanks for great implementation. However, I am unable to extract these data. They are in different format. Could you show how to extract them to see image files?

    Thanks

    opened by haithanhp 2
  • Which path to copy: VGGface2-HQ?

    Which path to copy: VGGface2-HQ?

    Sorry for the trivial question and ignorance, but it is often written where to copy the files in the simswap folder, in this case I don't find any information, okay in the main directory? thanks

    opened by stefo78 0
  • The link of VGGFace2-HQ not works i've downloaded from other place

    The link of VGGFace2-HQ not works i've downloaded from other place

    the link of dataset VGGFace2-HQ not works i've loaded from https://academictorrents.com/details/535113b8395832f09121bc53ac85d7bc8ef6fa5b

    The problem is that i don't know what's the right structure to decompress I have to create a VGGFace2 folder in the root folder? and data, meta?

    Could you explain the right structure?

    Thanks

    opened by ivaxsirc 2
  • Weight shape mismatch when running crop_align_vggface2_FFHQalign.py

    Weight shape mismatch when running crop_align_vggface2_FFHQalign.py

    After following the instructions to setup the environment, ./insightface_func/models, and ./experiments/pretrained_models...

    Running the following command:

    python scripts/crop_align_vggface2_FFHQalign.py --input_dir $DATAPATH$/VGGface2/train --output_dir_ffhqalign $ALIGN_OUTDIR$ --mode ffhq --crop_size 256
    

    Results in the following output

    input mean and std: 127.5 127.5
    find model: ./insightface_func/models/antelope/glintr100.onnx recognition
    find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection
    set det-size: (320, 320)
    
      0%|                                                   | 0/500 [00:00<?, ?it/s]2021-12-20 16:21:17.029441668 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {800,10} does not match actual shape of {200,10} for output 500
    2021-12-20 16:21:17.029507982 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {800,4} does not match actual shape of {200,4} for output 497
    2021-12-20 16:21:17.029540840 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {800,1} does not match actual shape of {200,1} for output 494
    2021-12-20 16:21:17.029912492 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {3200,10} does not match actual shape of {800,10} for output 477
    2021-12-20 16:21:17.029973895 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {3200,4} does not match actual shape of {800,4} for output 474
    2021-12-20 16:21:17.030020397 [W:onnxruntime:, execution_frame.cc:811 VerifyOutputSizes] Expected shape from model of {3200,1} does not match actual shape of {800,1} for output 471
    ...
    

    It continues to throw warnings for hundreds of other weights, which I have not included here.

    Is this expected behavior?

    opened by jhkonan 1
  • Missing Test Set

    Missing Test Set

    I unzipped the files on Google Drive, but it only creates a directory with 8631 classes for the training set. Is it possible for you to add the remaining 500 classes for VGGFace2 test set?

    Thank you for sharing this resource!

    opened by jhkonan 6
Owner
Naiyuan Liu
Naiyuan Liu
A fast poisson image editing implementation that can utilize multi-core CPU or GPU to handle a high-resolution image input.

Poisson Image Editing - A Parallel Implementation Jiayi Weng (jiayiwen), Zixu Chen (zixuc) Poisson Image Editing is a technique that can fuse two imag

Jiayi Weng 110 Dec 27, 2022
Boosting Monocular Depth Estimation Models to High-Resolution via Content-Adaptive Multi-Resolution Merging

Boosting Monocular Depth Estimation Models to High-Resolution via Content-Adaptive Multi-Resolution Merging This repository contains an implementation

Computational Photography Lab @ SFU 1.1k Jan 2, 2023
Implementation for HFGI: High-Fidelity GAN Inversion for Image Attribute Editing

HFGI: High-Fidelity GAN Inversion for Image Attribute Editing High-Fidelity GAN Inversion for Image Attribute Editing Update: We released the inferenc

Tengfei Wang 371 Dec 30, 2022
Official code release for: EditGAN: High-Precision Semantic Image Editing

Official code release for: EditGAN: High-Precision Semantic Image Editing

null 565 Jan 5, 2023
Code for HLA-Face: Joint High-Low Adaptation for Low Light Face Detection (CVPR21)

HLA-Face: Joint High-Low Adaptation for Low Light Face Detection The official PyTorch implementation for HLA-Face: Joint High-Low Adaptation for Low L

Wenjing Wang 77 Dec 8, 2022
DeepFaceEditing: Deep Face Generation and Editing with Disentangled Geometry and Appearance Control

DeepFaceEditing: Deep Face Generation and Editing with Disentangled Geometry and Appearance Control One version of our system is implemented using the

null 260 Nov 28, 2022
Disentangled Face Attribute Editing via Instance-Aware Latent Space Search, accepted by IJCAI 2021.

Instance-Aware Latent-Space Search This is a PyTorch implementation of the following paper: Disentangled Face Attribute Editing via Instance-Aware Lat

null 67 Dec 21, 2022
[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing

InterFaceGAN - Interpreting the Latent Space of GANs for Semantic Face Editing Figure: High-quality facial attributes editing results with InterFaceGA

GenForce: May Generative Force Be with You 1.3k Dec 29, 2022
InterFaceGAN - Interpreting the Latent Space of GANs for Semantic Face Editing

InterFaceGAN - Interpreting the Latent Space of GANs for Semantic Face Editing Figure: High-quality facial attributes editing results with InterFaceGA

GenForce: May Generative Force Be with You 1.3k Jan 9, 2023
Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels.

The Face Synthetics dataset Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels. It was introduced in ou

Microsoft 608 Jan 2, 2023
The project is an official implementation of our CVPR2019 paper "Deep High-Resolution Representation Learning for Human Pose Estimation"

Deep High-Resolution Representation Learning for Human Pose Estimation (CVPR 2019) News [2020/07/05] A very nice blog from Towards Data Science introd

Leo Xiao 3.9k Jan 5, 2023
TACTO: A Fast, Flexible and Open-source Simulator for High-Resolution Vision-based Tactile Sensors

TACTO: A Fast, Flexible and Open-source Simulator for High-Resolution Vision-based Tactile Sensors This package provides a simulator for vision-based

Facebook Research 255 Dec 27, 2022
A Fast and Stable GAN for Small and High Resolution Imagesets - pytorch

A Fast and Stable GAN for Small and High Resolution Imagesets - pytorch The official pytorch implementation of the paper "Towards Faster and Stabilize

Bingchen Liu 455 Jan 8, 2023
Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two

512x512 flowers after 12 hours of training, 1 gpu 256x256 flowers after 12 hours of training, 1 gpu Pizza 'Lightweight' GAN Implementation of 'lightwe

Phil Wang 1.5k Jan 2, 2023
AOT-GAN for High-Resolution Image Inpainting (codebase for image inpainting)

AOT-GAN for High-Resolution Image Inpainting Arxiv Paper | AOT-GAN: Aggregated Contextual Transformations for High-Resolution Image Inpainting Yanhong

Multimedia Research 214 Jan 3, 2023
QueryDet: Cascaded Sparse Query for Accelerating High-Resolution SmallObject Detection

QueryDet-PyTorch This repository is the official implementation of our paper: QueryDet: Cascaded Sparse Query for Accelerating High-Resolution Small O

Chenhongyi Yang 276 Dec 31, 2022
This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution Network.

Lite-HRNet: A Lightweight High-Resolution Network Introduction This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution

HRNet 675 Dec 25, 2022
Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encoding

Vision Longformer This project provides the source code for the vision longformer paper. Multi-Scale Vision Longformer: A New Vision Transformer for H

Microsoft 209 Dec 30, 2022
Official implement of Paper:A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sening images

A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sensing images 深度监督影像融合网络DSIFN用于高分辨率双时相遥感影像变化检测 Of

Chenxiao Zhang 135 Dec 19, 2022