Repository navigation
Conversation
This branch has not been deployed
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.
Adds an “Element Identification” tab to the Elemental Analysis window. It runs trained machine learning (ML) models that classify which elements are present in a whole muonic X-ray spectrum and lists the result per plotted detector. Models are discovered from core/ml_identification/models//. Each folder holds model.pt and elements_library.npz, plus an optional settings.json for models trained on a different energy grid. The tab refuses to run unless Display Plot is a spectrum mode.
Questions for maintainers:
This change adds torch as a required dependency in pyproject.toml, because the ML models need it to run. It makes the install larger, adds to the size of the PyInstaller build, and torch takes a while to import when EVA starts. Would you prefer to keep it as a required dependency, or make it optional (for example pip install eva[ml]), so that the Element Identification tab only appears when torch is installed? I’m happy to make that change if you’d prefer it.
The three trained models (model.pt and elements_library.npz for each) are committed under src/EVA/core/ml_identification/models/. They’re about 1.5 MB each, so I didn’t use Git LFS. Is it acceptable to keep them in the repository like this, or would you prefer them stored elsewhere?
I’ve added torch to pyproject.toml only, because the CI workflow installs from there (pip install -e .). I haven’t changed requirements.txt. Please let me know if torch should be listed there as well, and I’ll add it.