Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to assign multiple graph files to one stick

Is there a sample program that assigns multiple graph files to one Stick?
I looked for "ncappzoo", but I could not find a good sample.
I would like to solve MTCNN face detection with NCSDK v2 multi graph.
I guess that it can be realized by sequentially executing multiple reasoning.
However, It is obvious that performance will suffer.
Other engineers are trying, so I want to establish a way to make it work somehow.
I am not conscious of performance first.

◆7 graph files

◆Save the graph file to

◆The repository I am referring to


  • 14 Comments sorted by Votes Date Added
  • edited August 17 Vote Up1Vote Down

    look here~
    I have test out how to assign multiple graph at the same time just now:
    step 1:
    we need declare 3 graph object like this:

    graph1 = mvncapi.Graph('onet')
    graph2 = mvncapi.Graph('net12')
    graph3 = mvncapi.Graph('net24')

    then allocate the room of NCS Stick:

    input_fifo_onet,output_fifo_onet = graph1.allocate_with_fifos(device, graph_buffer_o)
    input_fifo_12net,output_fifo_12net= graph2.allocate_with_fifos(device, graph_buffer_12net)
    input_fifo_24net,output_fifo_24net = graph3.allocate_with_fifos(device, graph_buffer_24net)

    after that 3 graph have been put into the stick,
    it may be can save your some time

  • oh !
    We are doing the same work,
    it seems there is no demo to assign two graph into a stick,
    I want an guidence too.

  • @Tome_at_Intel

    Because there is a time difference, let 's wait for Tome to wake up.

  • @PINTO
    It seemed that you have spilt the multiple output layers which will lead to more time waste,
    there is a more suitable way to compile the multiple output of the network,

    with a reshape layer followed , we needn't to spilt the network
    maybe you could have a try

  • It seems that we could not allocate 3 network graph like this,
    input_fifo_onet,output_fifo_onet = graph.allocate_with_fifos(device, graph_buffer_o)
    input_fifo_12net,output_fifo_12net= graph.allocate_with_fifos(device, graph_buffer_12net)
    input_fifo_24net,output_fifo_24net = graph.allocate_with_fifos(device, graph_buffer_24net)

    the fifo is likely to be a data input and output queue rather than graph's queue,
    or anything I have did wrong?

  • edited August 17 Vote Up0Vote Down

    Are you a genius!?
    First of all, as you suggested, I need to concatenate the graph files and compile them.
    However, I will implement the logic as soon as possible and try to check the operation.
    Have you already implemented successfully?

  • edited August 17 Vote Up0Vote Down

    the net work get from your link have been compile and check successfully,
    but the logic of the has troubled me a long time,
    I could not understand his codes' logic

  • @zufeifei
    I am embracing a baby now, so I can not write a program.
    The following is easier to read.

  • @PINTO
    the codes contains these codes

        neither ws nor hs equals 12.

    the first step is generating multiple scales
    in caffe , we can assign
    to change the input's layer's shape to generate multiple scales,
    but for NCS stick,
    we can change input shape after the graph have been generated.
    It seems have to been a problem for MTCNN tranlatant.

  • we can not change input shape after the graph have been generated,
    a " not " missing,

  • @zufeifei
    I spent a lot of time trying it, but I did not succeed.
    All that you pointed out is correct.
    The API of NCSDK is too immature.
    It is quicker to use OpenCV's FaceDetection.
    The operating speed is quite slow, but the program can be written quite simply.

  • Is there any limit of number graph that can be assigned to one stick. And is there any maximum size limit?

  • @Akhilesh

    limit number of graph=2 ---> BUG of NCSDK v2
    limit size=500MB

  • @PINTO , Thanks for the response.

Sign In or Register to comment.