onnx_test.cpp
: main C++ fileCMakeLists.txt
flake.nix
anddefault.nix
for reproducible buildsbuild.sh
for non-nix buildscat_small.jpg
original input filecat_sr.png
C++ ONNX outputcat_sr_pytorch.png
PyTorch and Python ONNX output
nix build
# or, if you don't like flakes:
nix-build
You will find the executable in ./result/bin/onnx_test
Dependencies:
- ONNX
- OpenCV
You can use build.sh
which just contains:
# create build dir if it does not exist
[ -d build ] || mkdir build
# generate builder
cmake . -B build
# build
cmake --build build
<executable_name> <onnx-model> <source-img> <dest-img>
for example:
<executable_name> bsrgan-pretrained.onnx cat_small.jpg cat_sr.png