【计算机视觉】seetaFace

class impl

class FaceDetection::Impl {
public:
Impl()
: detector_(new seeta::fd::FuStDetector()),
slide_wnd_step_x_(), slide_wnd_step_y_(),
min_face_size_(), max_face_size_(-),
cls_thresh_(3.85f) {} ~Impl() {} inline bool IsLegalImage(const seeta::ImageData & image) {
return (image.num_channels == && image.width > && image.height > &&
image.data != nullptr);
} public:
static const int32_t kWndSize = ; int32_t min_face_size_;
int32_t max_face_size_;
int32_t slide_wnd_step_x_;
int32_t slide_wnd_step_y_;
float cls_thresh_; std::vector<seeta::FaceInfo> pos_wnds_;
std::unique_ptr<seeta::fd::Detector> detector_;
seeta::fd::ImagePyramid img_pyramid_;
};

score

impl_->pos_wnds_ = impl_->detector_->Detect(&(impl_->img_pyramid_));

fust.cpp

std::vector<seeta::FaceInfo> FuStDetector::Detect(
seeta::fd::ImagePyramid* img_pyramid) {

score

        for (int32_t i = ; i < hierarchy_size_[]; i++) {
if (model_[i]->Classify(&score)) {
wnd_info.score = static_cast<double>(score);
proposals[i].push_back(wnd_info);
}
}

2

          if (model_[model_idx]->Classify(&score, mlp_predicts.data())) {
float x = static_cast<float>(bboxes[m].bbox.x);
float y = static_cast<float>(bboxes[m].bbox.y);
float w = static_cast<float>(bboxes[m].bbox.width);
float h = static_cast<float>(bboxes[m].bbox.height); bboxes[bbox_idx].bbox.width =
static_cast<int32_t>((mlp_predicts[] * - ) * w + w + 0.5);
bboxes[bbox_idx].bbox.height = bboxes[bbox_idx].bbox.width;
bboxes[bbox_idx].bbox.x =
static_cast<int32_t>((mlp_predicts[] * - ) * w + x +
(w - bboxes[bbox_idx].bbox.width) * 0.5 + 0.5);
bboxes[bbox_idx].bbox.y =
static_cast<int32_t>((mlp_predicts[] * - ) * h + y +
(h - bboxes[bbox_idx].bbox.height) * 0.5 + 0.5);
bboxes[bbox_idx].score = score;
bbox_idx++;
}
上一篇:我也要学iOS逆向工程--函数


下一篇:Java泛型-内部原理: 类型擦除以及类型擦除带来的问题