zoukankan      html  css  js  c++  java
  • 【计算机视觉】seetaFace

    class impl

    class FaceDetection::Impl {
     public:
      Impl()
          : detector_(new seeta::fd::FuStDetector()),
            slide_wnd_step_x_(4), slide_wnd_step_y_(4),
            min_face_size_(20), max_face_size_(-1),
            cls_thresh_(3.85f) {}
    
      ~Impl() {}
    
      inline bool IsLegalImage(const seeta::ImageData & image) {
        return (image.num_channels == 1 && image.width > 0 && image.height > 0 &&
          image.data != nullptr);
      }
    
     public:
      static const int32_t kWndSize = 40;
    
      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_;
    };
    View Code

    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 = 0; i < hierarchy_size_[0]; 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[3] * 2 - 1) * 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[1] * 2 - 1) * w + x +
                  (w - bboxes[bbox_idx].bbox.width) * 0.5 + 0.5);
                bboxes[bbox_idx].bbox.y =
                  static_cast<int32_t>((mlp_predicts[2] * 2 - 1) * h + y +
                  (h - bboxes[bbox_idx].bbox.height) * 0.5 + 0.5);
                bboxes[bbox_idx].score = score;
                bbox_idx++;
              }
  • 相关阅读:
    mac 环境下adb的安装
    iOS开发Swift版本
    UILabel-Swift
    Android应用上架
    Android应用开发
    andriod
    Android 6.0 更新包与已安装应用的签名不一致
    苹果手机怎么录屏 iOS12设置录屏
    Siri语音唤醒的开启与语音矫正
    Git的工作流程
  • 原文地址:https://www.cnblogs.com/happyamyhope/p/10256306.html
Copyright © 2011-2022 走看看