All Projects → Tengfei-Wang → HFGI

Tengfei-Wang / HFGI

Licence: other
CVPR 2022 HFGI: High-Fidelity GAN Inversion for Image Attribute Editing

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
Cuda
1817 projects

Projects that are alternatives of or similar to HFGI

HistoGAN
Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
Stars: ✭ 158 (-58.85%)
Mutual labels:  image-editing, image-manipulation
ManTraNet-pytorch
Implementation of the famous Image Manipulation\Forgery Detector "ManTraNet" in Pytorch
Stars: ✭ 47 (-87.76%)
Mutual labels:  image-editing, image-manipulation
PTI
Official Implementation for "Pivotal Tuning for Latent-based editing of Real Images" (ACM TOG 2022) https://arxiv.org/abs/2106.05744
Stars: ✭ 523 (+36.2%)
Mutual labels:  image-editing, gan-inversion
SDEdit
PyTorch implementation for SDEdit: Image Synthesis and Editing with Stochastic Differential Equations
Stars: ✭ 394 (+2.6%)
Mutual labels:  image-editing, image-manipulation
Image recoloring
Image Recoloring Based on Object Color Distributions (Eurographics 2019)
Stars: ✭ 30 (-92.19%)
Mutual labels:  image-editing, image-manipulation
Jspaint
🎨 Classic MS Paint, REVIVED + ✨Extras
Stars: ✭ 5,972 (+1455.21%)
Mutual labels:  image-editing, image-manipulation
pytorch sscr
A PyTorch implementation of SSCR
Stars: ✭ 25 (-93.49%)
Mutual labels:  image-editing
hms-image-vision-java
This sample code is to guide the developer how to integrate the Image Vision Sub-service of the Image Kit, calling the image filter function. This sub-service provides 24 unique filter effects to enhance the artistic conception and artistic sense of the images.
Stars: ✭ 22 (-94.27%)
Mutual labels:  image-editing
Finegan
FineGAN: Unsupervised Hierarchical Disentanglement for Fine-grained Object Generation and Discovery
Stars: ✭ 240 (-37.5%)
Mutual labels:  image-manipulation
Paddlegan
PaddlePaddle GAN library, including lots of interesting applications like First-Order motion transfer, wav2lip, picture repair, image editing, photo2cartoon, image style transfer, and so on.
Stars: ✭ 4,987 (+1198.7%)
Mutual labels:  image-editing
Pel
PHP Exif Library - library for reading and writing Exif headers in JPEG and TIFF files using PHP.
Stars: ✭ 232 (-39.58%)
Mutual labels:  image-manipulation
Graphite
Open source 2D node-based raster/vector graphics editor (Photoshop + Illustrator + Houdini = Graphite)
Stars: ✭ 223 (-41.93%)
Mutual labels:  image-manipulation
Bild
Image processing algorithms in pure Go
Stars: ✭ 3,431 (+793.49%)
Mutual labels:  image-editing
goat
Annotate Images (or goats) On The Web™
Stars: ✭ 75 (-80.47%)
Mutual labels:  image-editing
powerpaint
Kreative PowerPaint - Library and Application for Bitmap and Vector Image Editing
Stars: ✭ 27 (-92.97%)
Mutual labels:  image-editing
CoCosNet-v2
CoCosNet v2: Full-Resolution Correspondence Learning for Image Translation
Stars: ✭ 312 (-18.75%)
Mutual labels:  image-manipulation
Flameshot
Powerful yet simple to use screenshot software 🖥️ 📸
Stars: ✭ 15,429 (+3917.97%)
Mutual labels:  image-editing
Litrato
Android photo editing app with various filters and tools. Included advanced features like masking, histogram, color picker, EXIF viewer...
Stars: ✭ 54 (-85.94%)
Mutual labels:  image-editing
js-image-carver
🌅 Content-aware image resizer and object remover based on Seam Carving algorithm
Stars: ✭ 1,467 (+282.03%)
Mutual labels:  image-manipulation
SwiftyJot
Use your finger to annotate images.
Stars: ✭ 14 (-96.35%)
Mutual labels:  image-editing

HFGI: High-Fidelity GAN Inversion for Image Attribute Editing (CVPR 2022)

High-Fidelity GAN Inversion for Image Attribute Editing
https://tengfei-wang.github.io/HFGI/

Update: We released the inference code and the pre-trained model on Oct. 31. The training code is coming soon.
Update: We provided a Colab notebook for play.
Update: We released the training code.

paper | supp. | project website | demo video | Colab | online demo

Introduction

We present a novel high-fidelity GAN inversion framework that enables attribute editing with image-specific details well-preserved (e.g., background, appearance and illumination).

To Do

  • Release the inference code
  • Release the pretrained model
  • Release the training code

Set up

Installation

git clone https://github.com/Tengfei-Wang/HFGI.git
cd HFGI

Environment

The environment can be simply set up by Anaconda (only tested for inference):

conda create -n HFGI python=3.7
conda activate HFGI
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install matplotlib
conda install ninja
conda install -c 3dhubs gcc-5

Or, you can also set up the environment from the provided environment.yml:

conda env create -f environment.yml

Quick Start

Pretrained Models

Please download our pre-trained model and put it in ./checkpoint.

Model Description
Face Editing Trained on FFHQ.

Prepare Images

We put some images from CelebA-HQ in ./test_imgs, and you can quickly try them (and other images from CelebA-HQ or FFHQ).
For customized images, it is encouraged to first pre-process (align & crop) them, and then edit with our model. See FFHQ for alignment details.

Inference

Modify inference.sh according to the follwing instructions, and run:
(It is possibly slow for the first-time running.)

bash inference.sh
Args Description
--images_dir the path of images.
--n_sample number of images that you want to infer.
--edit_attribute We provide options of 'inversion', 'age', 'smile', 'eyes', 'lip' and 'beard' in the script.
--edit_degree control the degree of editing (works for 'age' and 'smile').

Training

Preparation

  1. Download datasets and modify the dataset path in ./configs/paths_config.py accordingly.
  2. Download some pretrained models and put them in ./pretrained.
Model Description
StyleGAN2 (FFHQ) Pretrained face generator on FFHQ from rosinality.
e4e (FFHQ) Pretrained initial encoder on FFHQ from omertov.
Feature extractor (for face) Pretrained IR-SE50 model taken from TreB1eN for ID loss calculation.
Feature extractor (for car) Pretrained ResNet-50 model taken from omertov for ID loss calculation.

Start Training

Modify option and training.sh and run:

bash train.sh

Video Editing

The source videos and edited results in our paper can be found in this link.
For video editing, we first pre-process (align & crop) each frame, and then perform editing with the pre-trained model.

More Results

Citation

If you find this work useful for your research, please cite:

@inproceedings{wang2021HFGI,
  title={High-Fidelity GAN Inversion for Image Attribute Editing},
  author={Wang, Tengfei and Zhang, Yong and Fan, Yanbo and Wang, Jue and Chen, Qifeng},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2022}
}

Acknowledgement

Thanks to omertov for sharing their code.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].