#### 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!

#### Categories

Alert: Beginning Tuesday, June 25th, we will be freezing this site and migrating the content and forums to our new home at https://forums.intel.com/s/topic/0TO0P000000PqZDWA0/intel-neural-compute-sticks. Check it out now!

# 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
12net_conv42.graph
12net_prob1.graph
24net_conv52.graph
24net_prob1.graph
48net_conv62.graph
48net_conv63.graph
48net_prob1.graph

◆Save the graph file to
https://github.com/PINTO0309/MobileNet-SSD-RealSense.git

◆The repository I am referring to
https://github.com/CongWeilin/mtcnn-caffe.git

## Comments

• 14 Comments sorted by Votes Date Added
• edited August 2018

@PINTO
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

• @Akhilesh

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

• 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
Help!!

@zufeifei
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,
https://ncsforum.movidius.com/discussion/1087/concat-layer-have-not-been-support-yet#latest

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 2018

@zufeifei
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 2018

@PINTO
the net work get from your link have been compile and check successfully,
but the logic of the main.py has troubled me a long time,
I could not understand his codes' logic
https://github.com/CongWeilin/mtcnn-caffe.git

• @zufeifei
I am embracing a baby now, so I can not write a program.
The following run.py is easier to read.
https://github.com/DuinoDu/mtcnn.git

• @PINTO
the codes contains these codes

``````    net_12.blobs['data'].reshape(1,3,ws,hs)
net_12.blobs['data'].data[...]=scale_img
neither ws nor hs equals 12.
``````

the first step is generating multiple scales
in caffe , we can assign
net_12.blobs['data'].reshape(1,3,ws,hs)
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.
https://github.com/Mjrovai/OpenCV-Face-Recognition

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

• @PINTO , Thanks for the response.

This discussion has been closed.