MTCNN_face_detection_alignment icon indicating copy to clipboard operation
MTCNN_face_detection_alignment copied to clipboard

speed up mtcnn

Open Cv9527 opened this issue 7 years ago • 1 comments

@kpzhang93 mtcnn is slow by CPU, is there any solution to speed it up in real time?

Cv9527 avatar Apr 27 '17 03:04 Cv9527

Hi everyone, Reviewing a little bit the code(python+mxnet version) i noticed that first stage part on the detect_face method takes almost the entire time of the mtcnn processing. Specifically here:

    for batch in sliced_index:
        local_boxes = self.Pool.map( detect_first_stage_warpper, \
                zip(repeat(img), self.PNets[:len(batch)], [scales[i] for i in batch], repeat(self.threshold[0])) )
        total_boxes.extend(local_boxes)

For 1 image, the first batch in sliced_index is the slowest respect the next batches. I want to know if throwing the Pool the first time is more expense in terms of time than the others or there are some other reason

diego0718 avatar Sep 14 '21 12:09 diego0718