Real-ESRGAN-Demo / docs /ncnn_conversion.md
guetLzy's picture
Upload 11 files
f75ab98

A newer version of the Gradio SDK is available: 5.8.0

Upgrade

Instructions on converting to NCNN models

  1. Convert to onnx model with scripts/pytorch2onnx.py. Remember to modify codes accordingly
  2. Convert onnx model to ncnn model
    1. cd ncnn-master\ncnn\build\tools\onnx
    2. onnx2ncnn.exe realesrgan-x4.onnx realesrgan-x4-raw.param realesrgan-x4-raw.bin
  3. Optimize ncnn model
    1. fp16 mode
      1. cd ncnn-master\ncnn\build\tools
      2. ncnnoptimize.exe realesrgan-x4-raw.param realesrgan-x4-raw.bin realesrgan-x4.param realesrgan-x4.bin 1
  4. Modify the blob name in realesrgan-x4.param: data and output