Insightface: How to do batch inference?

Created on 3 Nov 2018  路  4Comments  路  Source: deepinsight/insightface

In deploy/face_embedding.py, the inference code is like this,
"
input_blob = np.expand_dims(aligned, axis=0)
data = mx.nd.array(input_blob)
db = mx.io.DataBatch(data=(data,))
self.model.forward(db, is_train=False)
_embedding = self.model.get_outputs()[0].asnumpy()
"
Now I get a lot of pictures to get embeddings, how can I do batch inference to accelerate the whole process.

Most helpful comment

Use data with shape [N,3,112,112]

how can I do batch inference for detection using mtcnn?

All 4 comments

Use data with shape [N,3,112,112]

Use data with shape [N,3,112,112]

how can I do batch inference for detection using mtcnn?

@nttstar how can I do batch inference for detection using mtcnn?

+1

Is there any way to do batch inference when using mtcnn?

Was this page helpful?
0 / 5 - 0 ratings