Skip to content

Additional models

Compare
Choose a tag to compare
@TransparentLC TransparentLC released this 14 Mar 14:08
· 168 commits to master since this release
2bb85f6

Source:

下载后将同名的 binparam 文件一起放到 models 目录下即可使用这些模型。可以根据 Upscale Wiki 的页面上各模型作者提供的说明以及实际的放大效果来决定选用哪一个模型。

请忽略 2-4x 以外倍率的模型,这些模型虽然能被原版 Real-ESRGAN-ncnn-vulkan 正常读取,但是输出的图片存在问题。

你也可以下载“竞品” Upscayl 提供的模型

Use these models by downloading the bin and param files with the same name and placing them in the models directory. You can find each model's purpose on Upscale Wiki‘s model database.

Please ignore models with scale ratio other than 2-4x. Original Real-ESRGAN-ncnn-vulkan can load these models but will produce incorrect images.

You can alse download models provided by our "competitor" Upscale.


关于“书之溯源 SourceBook”:

“书之溯源 SourceBook” 是针对书籍扫图制作数据集进行训练得到的模型,推荐对放大此类图片有需求的用户使用。

要想在 GUI 中使用这个模型,在下载以后,还需要进行以下操作:

  • 用压缩包中的 realesrgan-ncnn-vulkan.exe 替换掉原版的主程序(原版主程序在编译时禁用了一些 ncnn 的算子,其中一些算子是这个模型需要用到的)
  • 将模型的文件名从 RealESRGAN-SourceBook-latest-fp16.{bin,param} 重命名为 RealESRGAN-SourceBook-latest-fp16-x2.{bin,param}(这样 GUI 就可以识别到这是一个 2x 的模型了)

转换模型的方法:

  • 从 Upscale Wiki 下载一个 ESRGAN 类型的模型。
  • 使用脚本先从 pth 转换到 onnx。这个脚本来自 Real-ESRGAN repo 里的 pytorch2onnx.py,不过我进行了少量的修改。
  • 使用 NCNNonnx2ncnn 转换出 binparam
  • 修改 param 保证输入的名称为 data、输出的名称为 output,下面是一个示例。
  7767517
  72 73
- Input            input.1                  0 1 input.1
- Split            splitncnn_input0         1 2 input.1 input.1_splitncnn_0 input.1_splitncnn_1
+ Input            input.1                  0 1 data
+ Split            splitncnn_input0         1 2 data input.1_splitncnn_0 input.1_splitncnn_1
  Convolution      /body.0/Conv             1 1 input.1_splitncnn_1 /body.0/Conv_output_0 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728
  ...
  Interp           /Resize                  1 1 input.1_splitncnn_0 /Resize_output_0 0=1 1=4.000000e+00 2=4.000000e+00 3=0 4=0 6=0
- BinaryOp         /Add                     2 1 /upsampler/DepthToSpace_output_0 /Resize_output_0 208 0=0
+ BinaryOp         /Add                     2 1 /upsampler/DepthToSpace_output_0 /Resize_output_0 output 0=0

仅供参考,如果出现转换相关的问题请自行摸索解决方法。