feat(python): add GUNTAM Python-callable seeding example#5551
Conversation
Corentin-Allaire
left a comment
There was a problem hiding this comment.
Here are a few comments on the PR. One thionk I am not 100% sure is if we want to push Examples/Scripts/Python/onnx_seeding.py as is to the repo ?
- Add `SeedingAlgorithm.PythonCallable` configuration path. - Introduce `customSeeder` and `customSeederConfig` parameters. - Provide general interface for external/ML seeding functions.
2e8afda to
f6426a7
Compare
- r_max, z_max, score_threshold, and providers are now config parameters with the previous hardcoded values as defaults (500 mm, 1000 mm, 0.35, CPUExecutionProvider). - Remove z-degeneracy filter (_filter_degenerate_triplets / _Z_EPS): no longer needed after binding lifetime fixes removed the defensive crash- avoidance path. - Move duplicate-index check into _filter_valid_seeds (sanity check, not a physics cut). - Pre-allocate all seed proxies in one pass before filling to avoid repeated container growth inside the fill loop. - GPU support: pass providers=["CUDAExecutionProvider", "CPUExecutionProvider"] to use GPU with CPU fallback.
…exing Replace the per-seed Python loop over orig_idx with a single NumPy fancy indexing operation (orig_idx[seeds_v], shape N×3), then call .tolist() per row inside the fill loop.
SpacePointIndex2 = std::uint32_t; using int64 caused an implicit sign/range coercion on every assignSpacePointIndices call.
f6426a7 to
54aa262
Compare
|
|
drafting for now until we have a conclusion on #5571 which takes load off the gitlab ci |
@benjaminhuth I could try, but the code requires some of the guardrails (particularly the missing |



feat(python): add GUNTAM Python-callable seeding example
Add a PythonCallable seeding mode that allows reconstruction seeding to be
provided by a Python function.
Expose the event-data bindings needed by Python seeders to construct seeds
from Python, including mutable space point proxies, mutable seed proxies,
seed-spacepoint container assignment, and tests for the ownership path.
Add a GUNTAM ONNX seeding example using the OpenDataDetector workflow. The
integration is implemented for GUNTAM, while the PythonCallable interface
and ONNX example structure are intended to support other externally provided
ONNX seeding models as well.
--- END COMMIT MESSAGE ---
This PR adds:
SeedingAlgorithm.PythonCallablesupport through the reconstruction helpersSpacePointContainer2/MutableSpacePointProxy2bindingsSeedContainer2/MutableSeedProxy2bindings, including seed creation and space-point container assignmentIndexSourceLinkconstructor andmakeSourceLinkbindings in the examples moduleLocal validation:
origin/mainpytest Python/Core/tests/test_event_data.pypassedpy_compilepassed on both example scriptsonnx_seeding.pywith a GUNTAM model for 2 particle-gun events, single thread; full chain completed successfully through Fatras, digitization, seeding, CKF, ambiguity resolution, and vertex fittingcc @benjaminhuth @Corentin-Allaire