pixelshuffle定义:前人栽树:https://www.pianshen.com/article/33311325633/
算法思路:图像转张量(NxCxWxH)–增加C的维度–调用pixelshuffle
博主最近在做图像超分辨率重建,复现了SRCNN,RDN一些卷积之后concat再进行上采样的算法,今天做了一下简单的pixelshuffle。
import torch
from torch import nn
import cv2
import numpy as np
from torchvision import transforms
img1 = cv2.imread('./107.png',cv2.IMREAD_COLOR)
img1