Crfill
CR-Fill: Generative Image Inpainting with Auxiliary Contextual Reconstruction. ICCV 2021
Install / Use
/learn @zengxianyu/CrfillREADME
crfill
Usage | Web App | | Paper | Supplementary Material | More results |
code for paper ``CR-Fill: Generative Image Inpainting with Auxiliary Contextual Reconstruction". This repo (including code and models) are for research purposes only.
<img src="https://s3.ax1x.com/2020/11/27/DrVxIO.png" width="160"> <img src="https://s3.ax1x.com/2020/11/27/DrZ9RH.png" width="160"> <img src="https://s3.ax1x.com/2020/11/27/DrZlyn.png" width="160"> <img src="https://s3.ax1x.com/2020/11/27/DrZGwV.png" width="160">
<img src="https://s3.ax1x.com/2020/11/27/DrZtFU.png" width="360"> <img src="https://s3.ax1x.com/2020/11/27/DrZdSJ.png" width="360">
Usage
Dependencies
- Download code
git clone --single-branch https://github.com/zengxianyu/crfill
git submodule init
git submodule update
- Download data and model
chmod +x download/*
./download/download_model.sh
./download/download_data.sh
- Install dependencies:
conda env create -f environment.yml
or install these packages manually in a Python 3.6 enviroment:
pytorch=1.3.1, opencv=3.4.2, tqdm, torchvision, dill, matplotlib, opencv
Inference
./test.sh
These script will run the inpainting model on the samples I provided. Modify the options --image_dir, --mask_dir, --output_dir in test.sh to test on custom data.
Train
-
Prepare training datasets and put them in
./datasets/following the example./datasets/places -
run the training script:
./train.sh
open the html files in ./output to visualize training
After the training is finished, the model files can be found in ./checkpoints/debugarr0
you may modify the training script to use different settings, e.g., batch size, hyperparameters
Finetune
For finetune on custom dataset based on my pretrained models, use the following command:
- download checkpoints
./download/download_pretrain.sh
- run the training script
./finetune.sh
you may change the options in finetune.sh to use different hyperparameters or your own dataset
Web APP
<img src="https://s3.ax1x.com/2020/11/27/DrVLs1.png" width=300>To use the web app, these additional packages are required:
flask, requests, pillow
./demo.sh
then open http://localhost:2334 in the browser to use the web app
Citing
@inproceedings{zeng2021generative,
title={CR-Fill: Generative Image Inpainting with Auxiliary Contextual Reconstruction},
author={Zeng, Yu and Lin, Zhe and Lu, Huchuan and Patel, Vishal M.},
booktitle={Proceedings of the IEEE International Conference on Computer Vision},
year={2021}
}
Acknowledgement
- DeepFill https://github.com/jiahuiyu/generative_inpainting
- Pix2PixHD https://github.com/NVIDIA/pix2pixHD
- SPADE https://github.com/NVlabs/SPADE
Related Skills
node-connect
354.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
