-
Notifications
You must be signed in to change notification settings - Fork 1
/
priorbox.hpp
37 lines (32 loc) · 896 Bytes
/
priorbox.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef PRIORBOX_HPP
#define PRIORBOX_HPP
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include "face_def.hpp"
class PriorBox {
private:
const std::vector<std::vector<float>> min_sizes = {
{10.0f, 16.0f, 24.0f},
{32.0f, 48.0f},
{64.0f, 96.0f},
{128.0f, 192.0f, 256.0f}
};
const std::vector<int> steps = { 8, 16, 32, 64 };
const std::vector<float> variance = {0.1, 0.2};
int in_w;
int in_h;
int out_w;
int out_h;
std::vector<cv::Size> feature_map_sizes;
std::vector<BndBox_xywh> priors;
private:
std::vector<BndBox_xywh> generate_priors();
public:
PriorBox(const cv::Size& input_shape,
const cv::Size& output_shape);
~PriorBox();
std::vector<Face> decode(const cv::Mat& loc, const cv::Mat& conf, const cv::Mat& iou, const float ignore_score=0.3);
};
#endif