RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.74k stars 160 forks source link

Check supported output format before denoising #132

Closed imshvc closed 1 year ago

imshvc commented 2 years ago

Issue

oidnDenoise.exe starts the denoise process before ensuring the output format\ is supported by the compiled binary.

The command I used:

"C:\oidn\bin\oidnDenoise.exe"
    --device  cpu
    --alb     "C:\oidn\sample\0.pfm"
    --threads 4
    --maxmem  4096
    --output  "C:\oidn\output\0.png"

I mistakenly set the output file as 0.png instead of 0.pfm and waited for\ some time for the process to finish, until it said:

Error: cannot write unsupported image file format: 0.png

Approximate time wasted: 4 minutes and 13 seconds

The fix

  1. Check the output file extension 1.1 Terminate if conditions not met
  2. Proceed to the denoise process
atafra commented 2 years ago

oidnDenoise is not meant to be used as a full-featured denoising application but it's only a tutorial for developers. A 4 minute denoising time is rather unusual (it's typically not more than a second or two) so we haven't encountered this issue before. Adding an early file extension check is currently not planned but we welcome any pull requests that would do this.