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++;
              }
  • 相关阅读:
    html之长文本框置顶
    Red Hat Enterprise Linux Server 6.5安装GCC 4.9.2
    精通正则表达式
    解决UNION ALL合并两个结果集后排序的问题
    ELK搭建日志管理系统记录
    Spring Boot使用@ConfigurationProperties 读取自定义的properties的方法
    maven配置profile,按指定环境打包
    java自定义标签,tld文件,获取数据字典的值
    JAVA实现RSA签名、验签
    jquery.validate.js中的remote用法
  • 原文地址:https://www.cnblogs.com/happyamyhope/p/10256306.html
Copyright © 2011-2022 走看看