Tags: cobanov/depth2normal
Tags
2.0.1: fix the PyPI page and refresh the metadata (#7) The README is the package's description on PyPI, where there is no repository around it, so the two hero images and the LICENSE link were broken there: they were relative paths. They are absolute now. Also: - project.urls gains the demo as Homepage and the releases page as Changelog, and the GitHub description and topics match what the tool does (it never used OpenCV or MiDaS, both of which were listed). - The tests badge tracks the real count, 87. - The CLI version test reads the installed version instead of hardcoding it, so a bump does not need a test edit.
Camera intrinsics, normalised kernels, and measured benchmarks (#4) Closes #1: `--focal` treats the depth as metric distance from a pinhole camera, unprojects each pixel and returns the normals of that 3-D surface, so a plane keeps its orientation whatever its distance. Recovered against analytic planes to within 1e-4. That exposed a second problem: the Sobel and Scharr kernels had gains of 8 and 32, which the height field path hid inside `strength` but which made the metric form wrong. All three methods are now normalised, so a ramp of one unit per pixel reads as 1 and `strength` means the same thing whichever method is picked. Also: - The exported graph is pinned to IR version 10. ONNX Runtime 1.22 and earlier refuse anything above it, which the newest `onnx` emits by default, so the models would not load on a slightly older runtime. - `tools/benchmark.py`, and the README numbers now come from it: an M4 Pro and an i5-9600K with an RTX 3090, from 2 to 37 megapixels, portrait and landscape. - Answers #2 in the README: contour rings are the source's 8-bit steps amplified by the derivative, measured against the unquantised surface. - Depth estimation runs on CUDA when onnxruntime-gpu is installed: 32 ms on the 3090 against 231 ms on the M4 Pro CPU. - The browser demo is live at depth2normal.cobanov.dev.