I have trained my own .blob NN. It takes an Array as input, rather than an image.
I want to know how to send this array to the device? All examples I find on internet send frames from the camera.

Here is a picture of my code (I apologize for not providing it in text, but I tried and the format looks horrible):

If I run the code in the image, I get the following error:

TypeError: send(): incompatible function arguments. The following argument types are supported:
1. (self: depthai.DataInputQueue, msg: depthai.ADatatype) -> None
2. (self: depthai.DataInputQueue, rawMsg: depthai.RawBuffer) -> None

I would appreciate your help 🙂

  • erik replied to this.

    Hello tmendozarias,
    you should use NNData message (or Buffer) for that. Everything you send via XLink(In/Out) has to be a DepthAI message.

    Something like this should work:

    data = dai.NNData()
    data.setLayer('input_layer_name', [1,3,64,128])
    qIn.send(data)

    or, if you are using Script node (to send array to the NN node), you have to specify size of the message:

    buf = NNData(150)
    buf.setLayer("fp16_layer", [1.0, 1.2, 3.9, 5.5])
    buf.setLayer("uint8_layer", [6, 9, 4, 2, 0])
    #node.warn("Names of layers: " + str(buf.getAllLayerNames()))
    node.io['host'].send(buf)

    Thanks, Erik