Code Monkey home page Code Monkey logo

coordfill's Introduction


1 University of Macau   2 Tencent AI Lab  

🎼 Pipeline

overview2 Giving an input masked image, first, we resample the input image with a fixed resolution before fed to the network, which enables the contextual feature extraction under a unified receptive field. Then, we select the masked region features by the corresponding coordinates. For each spatial feature, we generate the required number of parameters by the linear mapping function, and the parameters are upsampled to the required resolution with nearest-neighbor interpolation. Next, we use the generated parameters to parameterize the pixel-wise querying network, Hence, we obtain a series of MLPs that are spatial-adaptive. Finally, the pixel-wise querying network takes the hole pixel’s coordinate as input and outputs the color values.

Environment

This code was implemented with Python 3.6 and PyTorch 1.8.1. You can install all the requirements via:

pip install -r requirements.txt

Demo

python demo.py --input [INPUT_PATH] --mask [MASK_PATH] --config [CONFIG_PATH] --model [MODEL_PATH] --resolution [HEIGHT],[WIDTH]

[INPUT_PATH]: input image

[MASK_PATH]: input mask

[CONFIG_PATH]: config file

[MODEL_PATH]: backbone checkpoint

[HEIGHT]: target height

[WIDTH]: target width

Train

Single GPU training:

python train.py --config [CONFIG_PATH]

Multi GPU training:

python -m torch.distributed.launch --nproc_per_node=[NUM_GPU] train_parallel.py --config [CONFIG_PATH]

Test

python test.py --config [CONFIG_PATH] --model [MODEL_PATH]

Models

Please find the pre-trained models here.

🛎 Citation

If you find our work useful in your research, please consider citing:

@inproceedings{liu2023coordfill,
  title={CoordFill: Efficient High-Resolution Image Inpainting via Parameterized Coordinate Querying},
  author={Liu, Weihuang and Cun, Xiaodong and Pun, Chi-Man and Xia, Menghan and Zhang, Yong and Wang, Jue},
  booktitle={AAAI},
  year={2023}
}

💗 Acknowledgements

CoordFill code borrows heavily from LIIF, ASAPNet and LAMA. We thank the author for sharing their wonderful code.

coordfill's People

Contributors

nifangbaage avatar vinthony avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.