Feature/hessian comparison #20
Open
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.
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):
New Utility (git_utils.py):
Modified XPointMLTest.py:
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.