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
連結已複製
14 回應
@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?
@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
@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?
@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
@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.
@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