Hi, I want to add a script node where I decode the results of a neural network.

Of course, I would also be able to do this on the host, but would like to do this on-device due to performance reasons. However, the modules available on a script node are (as I understand it) limited. Specifically, I would like to do some lightweight post processing using numpy. Is ist possible to make numpy available in a script node?

Also, is it even a good idea to do the decoding of NN results and post-processing steps such as NMS in a script node? What trade-offs are to be considered?

    Hi StefanWerner
    You have this example of on device decoding which doesn't use a script node but is fully on device.

    You can however still do some light postprocessing inside the script itself. Since numpy is not available, you will have to make do with raw python, or implement numpy functions as it was done with the MQTT library here.

    Since you are doing light work, you probably shouldn't experience any side-effects.

    Thanks,
    Jaka

    Thank you for the reply!

    In the first example, the decoding is done in native C/C++ (the yolo network class binding), right?

    So it is not possible to make extra modules available in script nodes? Could you explain why not?

      Hi StefanWerner

      StefanWerner In the first example, the decoding is done in native C/C++ (the yolo network class binding), right?

      Yes, it's done inside the node.

      StefanWerner So it is not possible to make extra modules available in script nodes? Could you explain why not?

      I don't think you can add additional modules to the script node (apart from writing your own). Not sure why, probably a hardware limitation or security reasons. I'll further sync with the team to see if anything can be done.

      Thanks,
      Jaka