python算法

pjf 64b2aefd87 启动全部python 3 veckor sedan
network 45a2472acc init 7 år sedan
pretrained_model 45a2472acc init 7 år sedan
src 45a2472acc init 7 år sedan
test_img d04144f690 Add files via upload 7 år sedan
test_output 12d908365e Add files via upload 6 år sedan
.gitignore 45a2472acc init 7 år sedan
LICENSE e0414a3215 Create LICENSE 4 år sedan
README.md 9950fe2dd3 Update README.md 6 år sedan
python算法时长计算研究生版.py 2e58cf5d32 算法 2 månader sedan
run_all.py 64b2aefd87 启动全部python 3 veckor sedan
test.lua 53a78ddf52 Update test.lua 7 år sedan
test.py 760b975e55 Update test.py 6 år sedan
train_corrector.py 967607df81 模型训练 1 månad sedan
反推含水量.py 34e0052d93 反推含水量 1 månad sedan
模型调用.py eaeac838e7 1 1 månad sedan
焦炭计算公式.py a2999ddf51 算法 1 månad sedan
煤矿途径地点初始温度代码接收java数据算法.py 2e58cf5d32 算法 2 månader sedan
解冻库python代码接收java算法数据.py 2934c6939d 算法--弃用 2 månader sedan

README.md

CartoonGAN-Test-Pytorch-Torch

Pytorch and Torch testing code of CartoonGAN [Chen et al., CVPR18]. With the released pretrained models by the authors, I made these simple scripts for a quick test.

Getting started

  • Linux
  • NVIDIA GPU
  • Pytorch 0.3
  • Torch

    git clone https://github.com/Yijunmaverick/CartoonGAN-Test-Pytorch-Torch
    cd CartoonGAN-Test-Pytorch-Torch
    

Pytorch

The original pretrained models are Torch nngraph models, which cannot be loaded in Pytorch through load_lua. So I manually copy the weights (bias) layer by layer and convert them to .pth models.

  • Download the converted models:

    sh pretrained_model/download_pth.sh
    
  • For testing:

    python test.py --input_dir YourImgDir --style Hosoda --gpu 0
    

Torch

Working with the original models in Torch is also fine. I just convert the weights (bias) in their models from CudaTensor to FloatTensor so that cudnn is not required for loading models.

  • Download the converted models:

    sh pretrained_model/download_t7.sh
    
  • For testing:

    th test.lua -input_dir YourImgDir -style Hosoda -gpu 0
    

Examples (Left: input, Right: output)

Note

  • The training code should be similar to the popular GAN-based image-translation frameworks and thus is not included here.

Acknowledgement