Add 2025.3.1 backwards-compat to ML models#2331
Merged
mcm001 merged 17 commits intoPhotonVision:mainfrom Jan 28, 2026
Merged
Conversation
samfreund
reviewed
Jan 24, 2026
photon-core/src/test/java/org/photonvision/common/configuration/SQLConfigTest.java
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
Gold856
requested changes
Jan 25, 2026
photon-core/src/main/java/org/photonvision/common/configuration/SqlConfigProvider.java
Outdated
Show resolved
Hide resolved
samfreund
reviewed
Jan 27, 2026
test-resources/old_configs/2025.3.1-old-nnmm/models/algaeV1-640-640-yolov8n.rknn
Show resolved
Hide resolved
samfreund
approved these changes
Jan 28, 2026
Co-authored-by: Gold856 <[email protected]>
8ab094d to
a352cbe
Compare
7 tasks
Gold856
approved these changes
Jan 28, 2026
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.
Description
In #1894 we decided for some reason not to be backwards compatible. But fixing this requires SSHing in and deleting files which is ugly. It's also not that much code to maintain compat. It also causes configs to be partially lost if Object Detection pipelines were saved (discovered via Discord report). In light of that discovery, changes were made to increase robustness to exceptions during config loading, including a more fine-grained try-catch.
Changes
NeuralNetworkModelManager::loadModelwill load legacy models from disk, and save toConfigManager.getInstance().getConfig().neuralNetworkPropertyManager().addModelProperties(properties);; this saves them to diskNeuralNetworkPropertyManagertoNeuralNetworkModelsSettingsModelPropertiesstring-only constructor to handle legacy serialization/deserialization from old ObjectDetection pipelines that just saved the nameSqlConfigProvider::loadCameraConfigsto be per-camera; one bad camera won't cause the rest to be skippedMeta
Merge checklist: