Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有一段代码不是很理解,有哪位大佬帮我解下惑 #291

Closed
yanchujian opened this issue Aug 8, 2023 · 1 comment
Closed

Comments

@yanchujian
Copy link

void UltraFace::generateBBox(std::vector &bbox_collection, MNN::Tensor *scores, MNN::Tensor *boxes) {
for (int i = 0; i < num_anchors; i++) {
if (scores->host()[i * 2 + 1] > score_threshold) {
FaceInfo rects;
float x_center = boxes->host()[i * 4] * center_variance * priors[i][2] + priors[i][0];
float y_center = boxes->host()[i * 4 + 1] * center_variance * priors[i][3] + priors[i][1];
float w = exp(boxes->host()[i * 4 + 2] * size_variance) * priors[i][2];
float h = exp(boxes->host()[i * 4 + 3] * size_variance) * priors[i][3];

        rects.x1 = clip(x_center - w / 2.0, 1) * image_w;
        rects.y1 = clip(y_center - h / 2.0, 1) * image_h;
        rects.x2 = clip(x_center + w / 2.0, 1) * image_w;
        rects.y2 = clip(y_center + h / 2.0, 1) * image_h;
        rects.score = clip(scores->host<float>()[i * 2 + 1], 1);
        bbox_collection.push_back(rects);
    }
}

}
就是这段代码中 ,x_center y_center w h这几个参数为什么以这样的方式生成,推理过程中为什么先有先验框的信息,这是rfb这个网络独有的吗

@yanchujian
Copy link
Author

经查看python代码 大致理解。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant