Skip to content
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

Auto 3033 fix incorrect nn path #5

Closed
wants to merge 10 commits into from
Closed

Conversation

MRo47
Copy link

@MRo47 MRo47 commented Sep 30, 2024

In

void parseConfigFile(const std::string& path, std::shared_ptr<T> nn, std::shared_ptr<dai::node::ImageManip> imageManip) {
        using json = nlohmann::json;
        std::ifstream f(path);
        json data = json::parse(f);
        if(data.contains("model") && data.contains("nn_config")) {
            auto modelPath = getModelPath(data);
            declareAndLogParam("i_model_path", modelPath);
            if(!getParam<bool>("i_disable_resize")) {
                setImageManip(modelPath, imageManip);
            }
            ...
  • At line declareAndLogParam("i_model_path", modelPath); above (in original_file)
  • The ros parameter is overridden with the path from nn_config file, line 3 below. This sometime might not be a path at all.
// nn_config.json
{
  "model": {
    "model_name": "forklift_openvino_yolov8n_2022",
    "zoo": "path"
  },
  ...
  • Since paths in the nn_config file cannot be hard coded but rather rely on the location of the shared install directory, it should be of lower precedence than a ros param (i_model_path) if its set.

TLDR

  • model path in nn_config file overrides ros param
  • this solves the issue by giving a higher priority to ros param, i.e: if its set it will override the path in nn_config file

@MRo47 MRo47 added the bug Something isn't working label Sep 30, 2024
@MRo47 MRo47 self-assigned this Sep 30, 2024
@MRo47 MRo47 force-pushed the AUTO-3033-fix_incorrect_nn_path branch from 83f3c42 to 215df84 Compare September 30, 2024 19:19
@MRo47
Copy link
Author

MRo47 commented Oct 4, 2024

got merged by vendor

@MRo47 MRo47 closed this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant