Feature/gaussian point model - #22
Draft
sridhs21 wants to merge 8 commits into
Draft
Conversation
…w, col, class columns for X/Omax/Omin points), with a backfill pass that writes CSVs for already-cached frames without re-running the classifier.
…d truth at the point level. match_points takes two coordinate arrays and a matching radius, builds a grid index on the gt side, and does greedy 1-to-1 nearest-neighbor matching to figure out tp/fp/fn (with optional confidence ordering so high-confidence preds claim matches first). evaluate_point_predictions runs that across many frames and gives back a global summary plus per-frame metrics. load_xpts_csv and load_xpts_csvs_for_frames are tiny helpers for reading the CSV format the cache builder emits.
…oint-list CSVs onto disk. backfill_xpts_csv.py walks a cache directory and writes per-frame {N}_xpts.csv files from existing {N}_xpts.npy plus optsMax/optsMin files, with an --output-dir flag for cases where the source cache isn't writable (like the PKPM cache, which is owned by another user). predict_points.py loads a trained checkpoint, runs inference over the cached frames of a dataset, post-processes the predicted heatmap with connected-component NMS to extract one peak per blob above threshold, then writes the predicted points as per-frame CSVs with row/col/confidence columns. Between them they cover both sides of the comparison: ground-truth points from the deterministic classifier, and predicted points from a neural net.
…st scoring together. Takes a predictions root directory (subdirs per dataset), loads the predicted xpts CSVs with their confidences plus the matching ground-truth CSVs from the per-dataset cache mirror, and runs evaluate_point_predictions from point_metrics on each dataset. Prints a per-dataset F1/precision/recall/TP/FP/FN table for the given checkpoint, and optionally writes the full per-frame breakdown to JSON via --json-out. Takes --radius and --datasets flags so you can tweak the matching radius or pick which subset of datasets to score without editing the script. Together with predict_points.py this closes the loop from checkpoint through NMS extraction through point-level comparison.
…tmapLoss, --gaussianSigma/--targetType/--heatmap* args) onto the point-list branch so a single working tree can both train at varying sigma and score with the point-list metric, for the sigma sweep experiment.
…PKPM run through cache build, prediction, and scoring
Contributor
|
Thank you. With the change to the model, are there changes needed in the top level README (e.g., new command line args, etc.)? |
sridhs21
marked this pull request as draft
August 21, 2026 17:17
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.
Reworks the X-point detector to train on Gaussian heatmap targets and to be
evaluated at the point level instead of per pixel. Stacked on the
hyperparameter-tuning and point-list-rework work, so it's a large PR; the
main pieces:
Gaussian heatmap model
--targetType gaussianplaces a Gaussian on each X-point (--gaussianSigma)instead of a dilated binary mask
FocalHeatmapLoss(CenterNet-style penalty-reduced focal loss) with--heatmapAlpha/--heatmapBetaPoint-level scoring pipeline
point_metrics.py: greedy 1-to-1 nearest-neighbor matching within a radius,plus the shared
extract_peaks(connected-component NMS, one peak per blob)predict_points.py: run a checkpoint, extract peaks, write per-frame{N}_xpts.csvwith confidencesrun_hessian_and_build_cache.py(renamed from build_transfer_cache.py):emits ground-truth
{N}_xpts.csvfrom the deterministic Hessian classifierbackfill_xpts_csv.py: writes CSVs from already-cached framesscore_point_predictions.py: aggregates predicted vs ground-truth CSVs intoper-dataset F1/precision/recall tables
Training / tuning infrastructure
test_xpoint_transfer.pyfor zero-shot eval on the 5M / 10M datasetsData