同步操作将从 PaddlePaddle/PaddleGAN 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
本应用的 AOT GAN 模型出自论文《Aggregated Contextual Transformations for High-Resolution Image Inpainting》,其通过聚合不同膨胀率的空洞卷积学习到的图片特征,刷出了inpainting任务的新SOTA。模型推理效果如下:
论文: Aggregated Contextual Transformations for High-Resolution Image Inpainting
参考repo: https://github.com/megvii-research/NAFNet
预训练模型权重文件 g.pdparams 可以从如下地址下载: (https://paddlegan.bj.bcebos.com/models/AotGan_g.pdparams)
输入一张 512x512 尺寸的图片和擦除 mask 给模型,输出一张补全(inpainting)的图片。预测代码如下:
python applications/tools/aotgan.py \
--input_image_path data/aotgan/armani1.jpg \
--input_mask_path data/aotgan/armani1.png \
--weight_path test/aotgan/g.pdparams \
--output_path output_dir/armani_pred.jpg \
--config-file configs/aotgan.yaml
参数说明:
AI Studio 快速体验项目:(https://aistudio.baidu.com/aistudio/datasetdetail/165081)
数据准备:
数据集目录结构如下:
└─data
└─aotgan
├─train_img
├─train_mask
├─val_img
└─val_mask
python -u tools/main.py --config-file configs/aotgan.yaml
!python -m paddle.distributed.launch \
tools/main.py \
--config-file configs/photopen.yaml \
-o dataset.train.batch_size=6
python -u tools/main.py \
--config-file configs/aotgan.yaml \
--resume output_dir/[path_to_checkpoint]/iter_[iternumber]_checkpoint.pdparams
在Places365模型的验证集上的指标如下
mask | PSNR | SSIM | download |
---|---|---|---|
20-30% | 26.04001 | 0.89011 | download |
@inproceedings{yan2021agg, author = {Zeng, Yanhong and Fu, Jianlong and Chao, Hongyang and Guo, Baining}, title = {Aggregated Contextual Transformations for High-Resolution Image Inpainting}, booktitle = {Arxiv}, pages={-}, year = {2020} }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。