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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

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 using file extension, 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 an accompanying json file listing its characteristics.

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

#1900 blocking cause I'm lazy and don't want to deal with merge conflicts on the front end.

  • 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

@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.

@samfreund
Copy link
Member Author

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

@Override
public boolean saveUploadedNeuralNetworkProperties(Path uploadPath) {
// TODO I'm not implementing this cause nobody with the legacy config is gonna have one of these
throw new UnsupportedOperationException(
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean this exception may be caught. Nuclear option is to System.exit

* family. A suggested solution is to add other version attributes, and the
* attribute for an unused version is to be left null.
*/
public class ModelProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider a static record

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.

2 participants