1 Star 0 Fork 0

朱海琦/bicubic-interpolation-pytorch-version-the-same-results-with-matlab-imresize

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 612 Bytes
一键复制 编辑 原始数据 按行查看 历史
unknown 提交于 6年前 . first commit
import scipy.misc
from PIL import Image
import torch
import scipy.io as sio
import numpy as np
from bicubic import *
import scipy.misc
import time
time_start = time.time()
time_end = time.time()
bicubic = bicubic()
img = np.array(Image.open('monarch.png'))
img = np.transpose(img,[2,0,1])
img = np.asarray(img, dtype = np.float32) / 255.0
img = torch.from_numpy(img).cuda().unsqueeze(0)
img_bicubic = bicubic(img, scale = 4)
img = img_bicubic[0]
img = np.transpose(img,[1,2,0])
time_end = time.time()
scipy.misc.toimage(img,cmin=0.0,cmax=1.0).save('mybicubic_4up.png')
print('totally cost',time_end-time_start)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhu_hai_qi0321/bicubic-interpolation-pytorch-version-the-same-results-with-matlab-imresize.git
git@gitee.com:zhu_hai_qi0321/bicubic-interpolation-pytorch-version-the-same-results-with-matlab-imresize.git
zhu_hai_qi0321
bicubic-interpolation-pytorch-version-the-same-results-with-matlab-imresize
bicubic-interpolation-pytorch-version-the-same-results-with-matlab-imresize
master

搜索帮助