• DepthAI-v2
  • Identifying camera from within a script node

Hi!

What would be the easiest way to identify the device from within a script node. I see there is an example where you can connect to the device using sockets and grab the IP, but that seems a bit too much. Is it possible to attach a property to the pipeline in a clean way which may be read from within the script (or something similar)?

Thanks!

    Hi Kristoffer
    There isn't a way to do that really. Why would you need the script node to know the device name? Perhaps there is a workaround.

    Thanks,
    Jaka

    I am using multiple cameras with the same pipeline configuration (and the same script). The cameras are placed at various angles surrounding the products.

    Within the script I am doing some NN detection and tracker logic before sending a custom string back to the host PC.

    The products may overlap and may contain other labels within the product itself. Depending on the camera angle I need to prioritize which product should own the containing labels.

    Eg. for camera1 I want left to right prioritization, but for camera2 I want right to left prioritization.

      5 days later

      Hi Jaka,

      Yes, I suppose I could do that, but it would still be nice to have an easier way to know which camera the script is running on. Something like an import device, device.ip or something similar. I will manage for now however if messages or sockets is the only way to do it.

      Thanks!