Advertisement

Exploiting Deep Generative Prior for Versatile Image Restoration and ManipulationECCV2020论文代码测试教程

阅读量:

该论文介绍了作者对深度生成模型进行的实验研究,并提供了相关的代码和配置信息。实验内容主要包括以下几方面:
环境配置:使用了PyTorch 1.1.0,并依赖多款开源库如torch geometric、pytorch Lightning等;服务器运行系统为Ubuntu 1~18.04;
测试结果:在ImageNet 128数据集上进行了Colorization、category transfer和超分(SR)实验;
论文源码:提供了论文的完整源码链接及下载地址,并附有训练脚本和模型权重文件等资源。

教程给出 环境配置 和 测试结果 和论文源码

论文:https://arxiv.org/abs/2003.13659

代码连接项:提供了该GitHub存储库中的深入生成先验实现

论文相关论文引用来源:第一篇参考文献第二篇参考文献

环境:

服务器: ubuntu1~18.04 Quadro RTX 5000 16GCUDA版本V10.0.130

复制代码
 conda create -n nice python=3.6.9

    
  
    
 conda activate nice
    
  
    
 pip install torch==1.1.0
    
  
    
 pip install torchvision==0.3.0
    
 或者(建议使用 conda 来安装)
    
 conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
    
  
    
 pip install pillow==5.2.0
    
  
    
 pip install opencv-python
    
  
    
 pip install scipy
    
 pip install thop
    
 pip install tensorboardX
    
    
    
    
    AI助手

官方测试过程:

个人测试过程:

运行:

复制代码
    sh experiments/examples/run_colorization.sh   
    
    
    AI助手

运行图像修复:

category_transfer 风格转换测试如下:

复制代码
    sh experiments/examples/run_category_transfer.sh 
    
    
    AI助手

SR 重建 命令如下:

源码分享附模型:

链接:https://pan.baidu.com/s/1vKwwBjUTUmbwCBTL7lwqyA?pwd=gus4

提取码:gus4

--来自百度网盘超级会员V1的分享

这是一份测试代码,没有对训练做深入研究,敬请理解:

复制代码
 tree

    
 .
    
 ├── data
    
 │   ├── ILSVRC2012_val_00000525.JPEG
    
 │   ├── ILSVRC2012_val_00001172.JPEG
    
 │   ├── ILSVRC2012_val_00001970.JPEG
    
 │   ├── ILSVRC2012_val_00003004.JPEG
    
 │   ├── ILSVRC2012_val_00004291.JPEG
    
 │   ├── ILSVRC2012_val_00008229.JPEG
    
 │   ├── ILSVRC2012_val_00020814.JPEG
    
 │   ├── ILSVRC2012_val_00022130.JPEG
    
 │   ├── ILSVRC2012_val_00042095.JPEG
    
 │   ├── ILSVRC2012_val_00044065.JPEG
    
 │   ├── ILSVRC2012_val_00044640.JPEG
    
 │   ├── manipulation.gif
    
 │   ├── others
    
 │   │   ├── library1.jpg
    
 │   │   ├── library2.jpeg
    
 │   │   ├── list.txt
    
 │   │   ├── stones.jpg
    
 │   │   ├── window1.jpg
    
 │   │   ├── window2.jpg
    
 │   │   └── window3.jpeg
    
 │   ├── restoration.gif
    
 │   └── windows.png
    
 ├── dataset.py
    
 ├── example.py
    
 ├── experiments
    
 │   ├── examples
    
 │   │   ├── images
    
 │   │   │   ├── ILSVRC2012_val_00008229_category_transfer.png
    
 │   │   │   ├── ILSVRC2012_val_00008229_category_transfer_target_origin.png
    
 │   │   │   ├── ILSVRC2012_val_00008229_category_transfer_target.png
    
 │   │   │   ├── ILSVRC2012_val_00008229_class151.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class152.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class153.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class154.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class155.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class156.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class157.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class158.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class159.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class160.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class161.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class162.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class163.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class164.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class165.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class166.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class167.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class168.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class169.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class170.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class171.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class172.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class173.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class174.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class175.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class176.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class177.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class178.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class179.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class180.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class181.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class182.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class183.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class184.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class185.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class186.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class187.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class188.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class189.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class190.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class191.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class192.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class193.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class194.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class195.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class196.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class197.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class198.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class199.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class200.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class201.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class202.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class203.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class204.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class205.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class206.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class207.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class208.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class209.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class210.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class211.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class212.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class213.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class214.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class215.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class216.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class217.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class218.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class219.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class220.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class221.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class222.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class223.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class224.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class225.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class226.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class227.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class228.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class229.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class230.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class231.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class232.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class233.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class234.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class235.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class236.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class237.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class238.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class239.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class240.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class241.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class242.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class243.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class244.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class245.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class246.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class247.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class248.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class249.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class250.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class251.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class252.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class253.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class254.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class255.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class256.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class257.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class258.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class259.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class260.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class261.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class262.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class263.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class264.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class265.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class266.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class267.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class268.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class269.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class270.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class271.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class272.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class273.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class274.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class275.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class276.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class277.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class278.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class279.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class280.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class281.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class282.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class283.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class284.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class285.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class286.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class287.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class288.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class289.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class290.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class291.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class292.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_class293.jpg
    
 │   │   │   ├── ILSVRC2012_val_00042095_SR.png
    
 │   │   │   ├── ILSVRC2012_val_00042095_SR_target_origin.png
    
 │   │   │   └── ILSVRC2012_val_00042095_SR_target.png
    
 │   │   ├── images_sheet
    
 │   │   │   ├── ILSVRC2012_val_00003004_colorization_2.jpg
    
 │   │   │   ├── ILSVRC2012_val_00003004_colorization.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_categories.jpg
    
 │   │   │   ├── ILSVRC2012_val_00008229_category_transfer.jpg
    
 │   │   │   └── ILSVRC2012_val_00042095_SR.jpg
    
 │   │   ├── logs
    
 │   │   │   └── log_train.txt
    
 │   │   ├── run_category_transfer.sh
    
 │   │   ├── run_colorization.sh
    
 │   │   ├── run_inpainting_list.sh
    
 │   │   ├── run_inpainting.sh
    
 │   │   ├── run_jitter.sh
    
 │   │   ├── run_morphing.sh
    
 │   │   └── run_SR.sh
    
 │   └── imagenet1k_128
    
 │       ├── colorization
    
 │       │   ├── train.sh
    
 │       │   └── train_slurm.sh
    
 │       ├── inpainting
    
 │       │   ├── train.sh
    
 │       │   └── train_slurm.sh
    
 │       └── SR
    
 │           ├── D_biased
    
 │           │   ├── train.sh
    
 │           │   └── train_slurm.sh
    
 │           └── MSE_biased
    
 │               ├── train.sh
    
 │               └── train_slurm.sh
    
 ├── LICENSE
    
 ├── main.py
    
 ├── models
    
 │   ├── biggan.py
    
 │   ├── dgp.py
    
 │   ├── downsampler.py
    
 │   ├── __init__.py
    
 │   ├── layers.py
    
 │   ├── nethook.py
    
 │   └── __pycache__
    
 │       ├── biggan.cpython-36.pyc
    
 │       ├── dgp.cpython-36.pyc
    
 │       ├── downsampler.cpython-36.pyc
    
 │       ├── __init__.cpython-36.pyc
    
 │       ├── layers.cpython-36.pyc
    
 │       └── nethook.cpython-36.pyc
    
 ├── pretrained
    
 │   ├── D_128.pth
    
 │   ├── D_256.pth
    
 │   ├── D_ch64_256.pth
    
 │   ├── G_ema_128.pth
    
 │   ├── G_ema_256.pth
    
 │   └── G_ema_ch64_256.pth
    
 ├── __pycache__
    
 │   ├── dataset.cpython-36.pyc
    
 │   └── trainer.cpython-36.pyc
    
 ├── README.md
    
 ├── requirements.txt
    
 ├── scripts
    
 │   └── imagenet_val_1k.txt
    
 ├── trainer.py
    
 └── utils
    
     ├── biggan_utils.py
    
     ├── common_utils.py
    
     ├── distributed_utils.py
    
     ├── __init__.py
    
     ├── losses.py
    
     └── __pycache__
    
     ├── biggan_utils.cpython-36.pyc
    
     ├── common_utils.cpython-36.pyc
    
     ├── distributed_utils.cpython-36.pyc
    
     ├── __init__.cpython-36.pyc
    
     └── losses.cpython-36.pyc
    
  
    
 20 directories, 229 files
    
  
    
    
    
    
    AI助手

接下来的这些东西可以让读者自行查看相关内容,并希望他们能够在提供的环境中运行代码。

全部评论 (0)

还没有任何评论哟~