Skip to content

Conversation

@disk02
Copy link
Owner

@disk02 disk02 commented Jan 10, 2026

Motivation

  • Overexposed / clipped highlights cause unstable 3DGS predictions and visible artifacts near saturated regions.
  • preprocess_one previously only converted uint8->float, divided by 255, and resized, with no highlight handling.
  • The goal is an always-on, automatic, lightweight local tone rolloff that only affects extreme highlights and preserves normal images.

Description

  • Implemented saturation detection and a soft-knee highlight rolloff inside preprocess_one using only tensor ops on the input device with constants sat_threshold=0.98, sat_frac_threshold=0.001, knee_start=0.98, and rolloff_strength=4.0.
  • Rolloff uses the provided formula y = knee_start + (1 - knee_start) * (1 - exp(-k * (x - knee_start) / (1 - knee_start))) and is applied elementwise for x > knee_start, followed by clamp(0,1).
  • Added aux metadata keys "highlight_rolloff_applied", "highlight_sat_frac", and "highlight_sat_frac_threshold" so callers can observe when the rolloff ran.
  • Added INFO logging when rolloff activates in both the batch CLI loop and the single-image predict_image path.

Testing

  • No automated tests were run as part of this change.
  • (Manual validation recommended by running the CLI over a mixed set of normal and overexposed images to confirm rolloff triggers only for saturated frames and reduces blown-highlight artifacts.)

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants