You've already forked UnitV2Framework
mirror of
https://github.com/m5stack/UnitV2Framework.git
synced 2026-05-20 10:30:55 -07:00
33 lines
525 B
C++
33 lines
525 B
C++
#ifndef ARCFACE_H
|
|
#define ARCFACE_H
|
|
|
|
#include <cmath>
|
|
#include <vector>
|
|
#include <string>
|
|
#include "net.h"
|
|
#include "base.h"
|
|
|
|
using namespace std;
|
|
|
|
ncnn::Mat preprocess(ncnn::Mat img, FaceInfo info);
|
|
|
|
float calcSimilar(std::vector<float> feature1, std::vector<float> feature2);
|
|
|
|
|
|
class Arcface {
|
|
|
|
public:
|
|
Arcface(string model_folder = ".");
|
|
~Arcface();
|
|
vector<float> getFeature(ncnn::Mat img);
|
|
|
|
private:
|
|
ncnn::Net net;
|
|
|
|
const int feature_dim = 128;
|
|
|
|
void normalize(vector<float> &feature);
|
|
};
|
|
|
|
#endif
|