Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6392 Discussions

How to assign multiple graph files to one stick

idata
Employee
813 Views

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
0 Kudos
14 Replies
idata
Employee
542 Views

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.
0 Kudos
idata
Employee
542 Views

@Tome_at_Intel

 

Help!!

 

@zufeifei

 

Because there is a time difference, let 's wait for Tome to wake up.
0 Kudos
idata
Employee
542 Views

@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
0 Kudos
idata
Employee
542 Views

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?
0 Kudos
idata
Employee
542 Views

@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
0 Kudos
idata
Employee
542 Views

@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?
0 Kudos
idata
Employee
542 Views

@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
0 Kudos
idata
Employee
542 Views

@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
0 Kudos
idata
Employee
542 Views

@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.
0 Kudos
idata
Employee
542 Views

we can not change input shape after the graph have been generated,

 

a " not " missing,
0 Kudos
idata
Employee
542 Views

@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
0 Kudos
idata
Employee
542 Views

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

0 Kudos
idata
Employee
542 Views

@Akhilesh

 

limit number of graph=2 ---> BUG of NCSDK v2

 

limit size=500MB
0 Kudos
idata
Employee
542 Views

@PINTO , Thanks for the response.

0 Kudos
Reply