Support selecting Object Detection models (#1359)

This PR is for part 1 of #1354. It focuses on adding a model selection
interface for models that exist in `photonvision_config/models/`. Upon
completion we can ship more than 1 model and users could upload their
own through `ssh` without deleting the shipped model. This PR also adds
the abstractions need to support more DNN backends (say OpenCV, or RPI
AI Kit)

Up next is adding a CRUD interface for managing models through the UI.
This commit is contained in:
Christopher Mahoney
2024-09-21 16:08:00 -04:00
committed by GitHub
parent 24fb6af5f4
commit 27cb69c094
20 changed files with 901 additions and 326 deletions

View File

@@ -423,6 +423,11 @@ public class Main {
ConfigManager.getInstance().load(); // init config manager
ConfigManager.getInstance().requestSave();
logger.info("Loading ML models...");
var modelManager = NeuralNetworkModelManager.getInstance();
modelManager.extractModels(ConfigManager.getInstance().getModelsDirectory());
modelManager.discoverModels(ConfigManager.getInstance().getModelsDirectory());
logger.debug("Loading HardwareManager...");
// Force load the hardware manager
HardwareManager.getInstance();
@@ -434,10 +439,6 @@ public class Main {
NetworkTablesManager.getInstance()
.setConfig(ConfigManager.getInstance().getConfig().getNetworkConfig());
logger.info("Loading ML models");
NeuralNetworkModelManager.getInstance()
.initialize(ConfigManager.getInstance().getModelsDirectory());
if (isSmoketest) {
logger.info("PhotonVision base functionality loaded -- smoketest complete");
System.exit(0);