← 开源

Unofficial pytorch implementation of 'Image Inpainting for Irregular Holes Using Partial Convolutions' [Liu+, ECCV2018]

Model DevelopmentArchitecturePython
增长势头
+024 小时新增 Star0.0%
609
Star
137
Fork
+0
本周
3
贡献者
创建于 2018-06-04 · 更新于 2026-09-14 · 今日第 20704 名
主要开发者
naoto0804theHamstavioletamenendez
README

pytorch-inpainting-with-partial-conv

Official implementation is released by the authors.

Note that this is an ongoing re-implementation and I cannot fully reproduce the results. Suggestions and PRs are welcome!

This is an unofficial pytorch implementation of a paper, Image Inpainting for Irregular Holes Using Partial Convolutions [Liu+, arXiv2018].

Requirements

  • Python 3.6+
  • Pytorch 0.4.1+
pip install -r requirements.txt

Usage

Preprocess

  • download Places2 and place it somewhere. The dataset should contain data_large, val_large, and test_large as the subdirectories. Don't forget to specify the root of the dataset by --root ROOT when using train.py or test.py

  • Generate masks by following [1] (saved under ./masks by default). Note that the way of the mask generation is different from the original work

python generate_data.py

Train

CUDA_VISIBLE_DEVICES=<gpu_id> python train.py

Fine-tune

CUDA_VISIBLE_DEVICES=<gpu_id> python train.py --finetune --resume <checkpoint_name>

Test

CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --snapshot <snapshot_path>

Results

Here are some results from the test set after the training of 500,000 iterations and fine-tuning (freezing BN in encoder) of 500,000 iterations. The model is available here, but I don't ensure the quality. (Top to bottom: input, mask, image generated by the network, image which is combined with the original non-masked region of image, ground truth)

References

排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载