Skip to content

Conversation

@mirkoCrobu
Copy link
Contributor

Motivation

closes #89

When a brick is assigned to an app, the FE must show the list of other compatible models for the installed brick.
For example when a new model is selected for a given brick installed into an app.

Change Description

 curl 127.0.0.1:8800/v1/apps/ZXhhbXBsZXM6dmlkZW8tZmFjZS1kZXRlY3Rpb24/bricks/arduino:video_object_detection 
{
  "id": "arduino:video_object_detection",
  "name": "Video Object Detection",
  "author": "Arduino",
  "category": "",
  "status": "installed",
  "variables": {
    "CUSTOM_MODEL_PATH": "/home/arduino/.arduino-bricks/ei-models/",
    "EI_OBJ_DETECTION_MODEL": "/models/ootb/ei/yolo-x-nano.eim",
    "VIDEO_DEVICE": "/dev/video1"
  },
  "config_variables": [
    {
      "name": "CUSTOM_MODEL_PATH",
      "value": "/home/arduino/.arduino-bricks/ei-models/",
      "description": "path to the custom model directory",
      "required": false
    },
    {
      "name": "EI_OBJ_DETECTION_MODEL",
      "value": "/models/ootb/ei/yolo-x-nano.eim",
      "description": "path to the model file",
      "required": false
    },
    {
      "name": "VIDEO_DEVICE",
      "value": "/dev/video1",
      "description": "",
      "required": false
    }
  ],
  "model": "face-detection"

   // the list of compatible models for the brick with minimal info.
   "models":[
       {
        "id": "yolox-object-detection",
        "name": "General purpose object detection - YoloX",
        "description": "",
  
         // TODO: what to show in the  "more info" button? Maybe only the "url"? 
      },
      {
        "id": "face-detection",
        "name": "Lightweight-Face-Detection",
        "description": "Face bounding box detection. This model is trained on the WIDER FACE dataset and can detect faces in images.",
      },
    },
    {
      "id": "arduino:web_ui",
      "name": "WebUI - HTML",
      "author": "Arduino",
      "category": "ui",
      "status": "installed"
    }
  ]
}

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@mirkoCrobu
Copy link
Contributor Author

Response:

GET http://localhost:8080/v1/apps/ZXhhbXBsZXM6aW1hZ2UtY2xhc3NpZmljYXRpb24/bricks/arduino:image_classification

{
    "id": "arduino:image_classification",
    "name": "Image Classification",
    "author": "Arduino",
    "category": "video",
    "status": "installed",
    "variables": {
        "CUSTOM_MODEL_PATH": "/home/arduino/.arduino-bricks/ei-models",
        "EI_CLASSIFICATION_MODEL": "/models/ootb/ei/mobilenet-v2-224px.eim"
    },
    "config_variables": [
        {
            "name": "CUSTOM_MODEL_PATH",
            "value": "/home/arduino/.arduino-bricks/ei-models",
            "description": "path to the custom model directory",
            "required": false
        },
        {
            "name": "EI_CLASSIFICATION_MODEL",
            "value": "/models/ootb/ei/mobilenet-v2-224px.eim",
            "description": "path to the model file",
            "required": false
        }
    ],
    "model": "mobilenet-image-classification",
    "compatible_models": [
        {
            "id": "mobilenet-image-classification",
            "name": "General purpose image classification",
            "description": "General purpose image classification model based on MobileNetV2. This model is trained on the ImageNet dataset and can classify images into 1000 categories."
        },
        {
            "id": "person-classification",
            "name": "Person classification",
            "description": "Person classification model based on WakeVision dataset. This model is trained to classify images into two categories: person and not-person."
        }
    ]
}

@mirkoCrobu
Copy link
Contributor Author

In the compatible_models section, should we also include the current model used, specified in the model field?
What do you think, @dido18? Should we check with the Design team?

@mirkoCrobu mirkoCrobu self-assigned this Nov 24, 2025
@lucarin91 lucarin91 marked this pull request as ready for review November 24, 2025 13:58
@Xayton
Copy link
Contributor

Xayton commented Nov 24, 2025

In the compatible_models section, should we also include the current model used, specified in the model field? What do you think, @dido18? Should we check with the Design team?

We discussed it and the answer is yes.

Variables: variables,
ConfigVariables: configVariables,
ModelID: modelID,
CompatibleModels: f.Map(s.modelsIndex.GetModelsByBrick(brick.ID), func(m modelsindex.AIModel) AIModel {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a unit test for the AppBrickInstanceDetails with the CompatibleModels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: add compatible models in the app brick details

3 participants