|
MTCNN的generateBbox函数,模型输出的score,loc有c h w属性:
vector<FaceInfo> MtcnnDetector::generateBbox(ncnn::Mat score, ncnn::Mat loc, float scale, float thresh)
{
int stride = 2;
int cellsize = 12;//人脸的最小检测范围
float *p = score.channel(1);//得到是否是人脸的概率
float inv_scale = 1.0f / scale;//放大的倍率
vector<FaceInfo> results;//用来存放生成候选框的集合
// printf("sssssssssss %d, %d \n", score.h, score.w);
for (int row = 0; row < score.h; row++)
{
for (int col = 0; col < score.w; col++)
{
if (*p > thresh)//人脸的概率大于阈值才生产候选框
在NPU输出的是一维数组,还是python版本的4倍:
float* location =(float*)outputs_pnet[0].buf;
float* score = (float*)outputs_pnet[1].buf;
后处理该怎么做,怎么reshape成CPU推理时相应的维度呢??
|
|