Skip to content

Migrate NNM Settings to SQLITE #1894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Jul 1, 2025
Merged

Conversation

samfreund
Copy link
Member

@samfreund samfreund commented Apr 14, 2025

Description

This migrates all the characteristics for neural network models to the sqlite database. The .rknn files themselves will stay in the file-system.

Each model will have a resolution characteristic (width x height), list of labels, nickname, family (currently only RKNN, but other families might be PRed later), and version.

When selecting the option to upload a custom model, users will be prompted to provide the model file and resolution. Family will be determined based on the platform (RKNN for opi), and users will be prompted to select a version based on the the family. Nickname will be assigned to the name of the file initially, and can be changed in the UI.

When shipped with the jar, each model will have its characteristics hardcoded in NNMM.

Also deletes object detection tests as they only reference the name parsing. More tests will be implemented at a later date (see #1905).

closes #1748

  • Frontend
  • Server
  • Database
  • Backend
  • Document

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2024.3.1
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@samfreund samfreund requested a review from a team as a code owner April 14, 2025 17:09
@samfreund samfreund marked this pull request as draft April 14, 2025 17:09
@samfreund samfreund closed this Apr 14, 2025
@samfreund samfreund reopened this Apr 14, 2025
@samfreund samfreund added the enhancement New feature or request label Apr 14, 2025
@samfreund
Copy link
Member Author

samfreund commented Apr 15, 2025

@mcm001 How do we want to handle importing object detection models from 2025? iirc all we had was the ability to export the .rknn and -labels.txt, so I'm not sure if it's worth supporting those for this year.

HARD BREAK LET'S GO

@samfreund
Copy link
Member Author

Also if anyone feels like reviewing the backend stuff, that's pretty much done.

@samfreund
Copy link
Member Author

samfreund commented Jun 28, 2025

NOTE TO SELF:

Remove stripping given new Jackson implementation
Funnily enough, it's still somewhat needed because we send it over json for the web ui 🤷 life's weird

@gerth2
Copy link
Contributor

gerth2 commented Jun 28, 2025

I got it loaded on my pi and seems functional in the basics.

One UI flow question: When doing a bulk upload, after I select the zip, there's no UI response indicating the file is uploading or being unpacked (kinda like the .jar does) - I was worried that things had frozen for a decent bit. Also, once it reports "rebooting", the modal remains up with no obvious close button (probably should auto-close, and also have a cancel button or an X):

image

Should change this to report progress - no freezing in place.

@gerth2
Copy link
Contributor

gerth2 commented Jun 28, 2025

Looks like this is not currently showing up at all on the Rubik Pi - I assume that's expected for now?

@samfreund
Copy link
Member Author

Looks like this is not currently showing up at all on the Rubric Pi - I assume that's expected for now?

Yup, as it's not currently supported.

@samfreund
Copy link
Member Author

I got it loaded on my pi and seems functional in the basics.

One UI flow question: When doing a bulk upload, after I select the zip, there's no UI response indicating the file is uploading or being unpacked (kinda like the .jar does) - I was worried that things had frozen for a decent bit. Also, once it reports "rebooting", the modal remains up with no obvious close button (probably should auto-close, and also have a cancel button or an X):

image

Should change this to report progress - no freezing in place.

The code is there for it to autoclose, but I'm guessing because the system reboots, it's no longer checking if the properties have changed or not. We could try reloading the page after, but again, it might not actually happen given the system is rebooting. I believe this same behavior would be seen when using the settings import button, I'm going to go test that.

@samfreund samfreund force-pushed the migrate-od branch 2 times, most recently from 3e96581 to c7b9cf5 Compare June 28, 2025 23:32
@samfreund samfreund requested a review from a team as a code owner June 28, 2025 23:32
@samfreund samfreund requested a review from gerth2 July 1, 2025 02:57
Copy link
Contributor

@gerth2 gerth2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we ball

@samfreund samfreund enabled auto-merge (squash) July 1, 2025 03:02
@samfreund samfreund merged commit 4a648b3 into PhotonVision:main Jul 1, 2025
39 checks passed
@samfreund samfreund deleted the migrate-od branch July 1, 2025 03:02
samfreund added a commit to samfreund/photonvision that referenced this pull request Jul 2, 2025
samfreund added a commit to samfreund/photonvision that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate object detection models (and all their junk) to SQLite database
4 participants