Repository navigation
Conversation
f-dy
marked this pull request as ready for review
September 29, 2026 07:09
Owner
|
Seems to still be a few negative results. Keeping default for now. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change
Closes #20.
class DaD(DeDoDeDetector): ... - subpixel_temp=0.5, + subpixel_temp=0.15, def load_DaD( ... - subpixel_temp=0.5, + subpixel_temp=0.15,dad/detectors/dedode_detector.py, theDaDclass default andload_DaD. Inference-only:loss.py:141,153pass
subpixel=False, so no retraining, no weight change, and it reverts by editing one number.load_DaDLightandload_DaDDarkare left at 0.5, since I have only measured the default weights.Evidence
T = 0.15, where T is the soft-argmax temperature
subpixel_temp, was chosen by sweeping T: every value fromT = 0.1 to T = 0.2 beat T = 0.5 on HPatches, and a sweep
on MegaDepth scene 0015 picked T = 0.15, which was also the best on the held-out scene 0022.
It was then checked with a paired comparison: each pair matched once, both temperatures scored on that
warp with identical RANSAC permutations. The harness first reproduces your Tables 2–6 at 512 keypoints
under RoMa v1 (58.07 / 64.82 / 50.70 / 26.23 / 19.01 against 58.2 / 64.9 / 50.6 / 25.7 / 18.3).
RoMa v1 is loaded as your benchmarks load it; RoMa v2 (
RoMaV2(), defaultprecisesetting) is passed tothe same benchmark code in its place. Both use the same
match_keypoints, which only pairs keypoints andreturns the detector's own coordinates, so v2 raises the absolute AUC without moving any keypoint, and
each change below is measured within one matcher.
Each cell is the AUC at T = 0.15, with the change from T = 0.5 in brackets. Bold marks a change clearly
larger than the benchmark's noise, which is roughly ±0.3 to ±0.5 AUC here; the rest are within it.
Ahead at 512 on all eight rows; no row clearly worse at any budget.
Why T = 0.15
Modelling the logits around a peak as
l(x) = c − (x − d)² / (2s²), withsthe peak width in scoremappixels, the soft-argmax's best temperature is
T = 0.342/s². That equalsT = 0.342·|D2|, whereD2 = l(−1) − 2l(0) + l(1)is the second difference at the peak, and DaD's median|D2|, measured over147k keypoints on 36 HPatches, MegaDepth and ScanNet images, is 0.49 (so
s= 1/√0.49 ≈ 1.43 px), giving T = 0.166; the per-keypoint residual against HPatches' true homographies, with nomatcher or RANSAC, is minimised at T = 0.171. The benchmarks can't separate values between about T = 0.1 and T = 0.2;
none of them prefers T = 0.5.
Not included
A clamped separable parabola, a clamped 2D quadratic fit and a per-keypoint temperature were tested on the
same harness. They tie T = 0.15 at 512 keypoints, and each regresses at 1024 where T = 0.15 does not: the per-keypoint
temperature and the 2D fit on ScanNet F, the separable fit on HPatches. So they are not worth the code.
Also adjacent:
sample_keypointsdivides by the temperature without subtracting the patch max(
dad/utils.py:179). Harmless in float32 at T = 0.15, but a one-line robustness fix if you want it.