resize[img_,imgScale_,device_:"CPU"]:=Block[{net,interpolated,ycbcr,channels,resizedNet,diff,rgb},net=NetModel["Very Deep Net for Super-Resolution"];interpolated=ImageResize[img,Scaled[imgScale],Resampling"Cubic"];ycbcr=ImageApply[{{0.257,0.504,0.09},{-0.148,-0.291,0.439},{0.439,-0.368,-0.071}}.#1+{0.063,0.502,0.502}&,interpolated];channels=ColorSeparate[ycbcr];resizedNet=NetReplacePart[net,"Input"NetEncoder[{"Image",ImageDimensions[interpolated],ColorSpace"Grayscale"}]];diff=Image[resizedNet[channels〚1〛,TargetDevicedevice]];ycbcr=ColorCombine[{channels〚1〛+diff,channels〚2〛,channels〚3〛}];rgb=ImageApply[{{1.164,0.,1.596},{1.164,-0.392,-0.813},{1.164,2.017,0.}}.#1+{-0.874,0.532,-1.086}&,ycbcr];rgb]