Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Add Hessian solver for per-detection regression head refinement#7

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-hessian-silver-regression
Open

Add Hessian solver for per-detection regression head refinement#7
Copilot wants to merge 4 commits intomainfrom
copilot/add-hessian-silver-regression

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Regression heads (depth, rotation, center offsets) lacked per-detection iterative refinement. Existing L-BFGS calibration only handles dataset-wide scale/intrinsics corrections.

Changes

Core solver (yolozu/calibration/hessian_solver.py):

  • Gauss-Newton with Levenberg-Marquardt damping for log_z, rot6d, and offset refinement
  • Supports optional GT supervision or regularization-only mode
  • Automatic convergence detection with NaN-safe early stopping
  • Jacobian computation via PyTorch autograd

CLI tool (tools/refine_predictions_hessian.py):

  • Batch refinement with configurable solver parameters
  • Optional GT supervision from dataset records
  • Class-based detection-to-GT matching

Documentation (docs/hessian_solver.md):

  • Algorithm details, configuration reference, performance characteristics
  • Comparison with L-BFGS calibration (per-detection vs dataset-wide)

Usage

from yolozu.calibration import HessianSolverConfig, refine_predictions_hessian

config = HessianSolverConfig(refine_depth=True, max_iterations=5)
refined = refine_predictions_hessian(predictions, records=dataset_records, config=config)

Or via CLI:

python tools/refine_predictions_hessian.py \
  --predictions reports/predictions.json \
  --dataset data/coco128 \
  --output refined.json \
  --refine-depth --refine-rotation

Typical convergence: 3-5 iterations, ~1-2ms per detection on CPU.

Original prompt

Hessian silver on heads
especially for regression stuff


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@thinksyncs thinksyncs marked this pull request as ready for review February 6, 2026 00:48
Copilot AI review requested due to automatic review settings February 6, 2026 00:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI and others added 3 commits February 6, 2026 00:49
Co-authored-by: thinksyncs <42225585+thinksyncs@users.noreply.github.com>
Co-authored-by: thinksyncs <42225585+thinksyncs@users.noreply.github.com>
Co-authored-by: thinksyncs <42225585+thinksyncs@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Hessian silver for regression analysis Add Hessian solver for per-detection regression head refinement Feb 6, 2026
Copilot AI requested a review from thinksyncs February 6, 2026 00:57
Copilot AI added a commit that referenced this pull request Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants