nagadomi / nunif

Misc; latest version of waifu2x; 2D video to stereo 3D video conversion
MIT License
1.42k stars 134 forks source link

Depth Map Export #179

Closed RelaxingVR closed 2 months ago

RelaxingVR commented 2 months ago

I had been using the Depth Anything model and additional tools to create SBS images/videos and found your incredible tool. I was looking for ways to export and also import depth/rgb from other tools and I believe it looks possible using the yml file as stated here (https://github.com/nagadomi/nunif/issues/97) - my question is, when I export from your tool the depth map is 686x392 (original frame 3840x2160) - if I use the Depth Anything V2 model directly the depth map is 3840x2160. Are you reducing this file size for export for efficiency, or are the generated frames used by iw3 drastically smaller like this? I am wondering if this is likely to degrade the quality of the final SBS or if you found in testing that it actually functions the same even reducing the depth map and maybe this was a trade-off you found to work well for speed vs quality? Which option could be used to generate larger depth maps? I tried a few and am not sure I found it.

The tool really is amazing and incredible to find all the features in one tool! Thank you so much!

RelaxingVR commented 2 months ago

Sorry, in addition - is depth-resoultion available in the CLI anywhere?

nagadomi commented 2 months ago

The exported depth images are the same size as the model output. The input image size for the depth estimation model can be changed with Depth Resolution (--zoed-height in CLI). See https://github.com/nagadomi/nunif/discussions/168 for more information on choosing Depth Resolution.

The DepthAnything V2 demo simply resizes it to the same size as the input image. If your application requires a depth image the same size as the input image, you can resize the depth with bicubic or bilinear. https://github.com/nagadomi/nunif/discussions/149 has a discussion about this processing in iw3.