Skip to content

Conversation

@sridhs21
Copy link
Contributor

@sridhs21 sridhs21 commented Dec 25, 2025

This PR introduces a new benchmarking script to compare the performance (execution time) of the traditional Hessian-based X-point detection against the new ML-based inference. It also adds utilities to log the current Git commit hash during runs to improve experiment reproducibility.

Key Changes

New Script (hessian_comparison.py):

  • Loads a trained model checkpoint
  • Runs both the Hessian-based detection (using auxFuncs) and the ML model on the same frames
  • Reports execution time for both methods and calculates the speedup factor

New Utility (git_utils.py):

  • Helper functions to retrieve and print the current Git commit hash, branch, and remote URL

Modified XPointMLTest.py:

  • Integrated git_utils to print version information at the start of execution

FAQ

1. Is inferencing done in serial on CPU or in parallel on GPU?

The inference loop runs sequentially in Python, processing one frame after another, but the mathematical operations for each individual frame are parallelized on the GPU. This basically allows the GPU to calculate the millions of pixel values in a single image simultaneously.

2. Does it run on multiple frames at once or just one at a time?

The current implementation processes frames strictly one at a time with a batch size of 1. It does not stack multiple frames together, though doing so (e.g., batch size of 4) could potentially increase throughput further.

3. How much memory is consumed?

The model weights themselves are very small, occupying only about 30 MB of memory. However, during inference on a 1024x1024 image, the GPU memory usage will likely range between 600 MB and 1 GB to store the large intermediate feature maps required by the U-Net architecture.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants