Skip to content

Commit

Permalink
Update facefeature
Browse files Browse the repository at this point in the history
  • Loading branch information
qianglin-xlnx committed Jul 13, 2020
1 parent 744fc03 commit cf5f709
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions Vitis-AI-Library/facefeature/include/vitis/ai/facefeature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ namespace ai {
* Float sample code :
* @code
cv:Mat image = cv::imread("test_face.jpg");
auto network = xilinx::ai::FaceFeature::create("facerec_resnet20", true);
auto network = vitis::ai::FaceFeature::create("facerec_resnet20", true);
auto result = network->run(image);
@endcode
*
* Fixed sample code :
* @code
cv:Mat image = cv::imread("test_face.jpg");
auto network = xilinx::ai::FaceFeature::create("facerec_resnet20", true);
auto network = vitis::ai::FaceFeature::create("facerec_resnet20", true);
auto result = network->run_fixed(image);
@endcode
*
Expand Down Expand Up @@ -80,8 +80,7 @@ namespace ai {
return (float)dot;
}
float feature_compare(const int8_t *feature, const int8_t *feature_lib,
float fuck = 0) {
float feature_compare(const int8_t *feature, const int8_t *feature_lib) {
float norm = feature_norm(feature);
float feature_norm_lib = feature_norm(feature_lib);
return feature_dot(feature, feature_lib) * norm * feature_norm_lib;
Expand Down
5 changes: 1 addition & 4 deletions Vitis-AI-Library/facefeature/test/test_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,14 @@ static float feature_dot(const int8_t *f1, const int8_t *f2) {
return (float)dot;
}

float feature_compare(const int8_t *feature, const int8_t *feature_lib,
float fuck = 0) {
float feature_compare(const int8_t *feature, const int8_t *feature_lib) {
float norm = feature_norm(feature);
float feature_norm_lib = feature_norm(feature_lib);
return feature_dot(feature, feature_lib) * norm * feature_norm_lib;
}

float score_map(float score) { return 1.0 / (1 + exp(-12.4 * score + 3.763)); }



int main(int argc,char* argv[]){
if(argc < 4){
std::cout << "usage : " << argv[0] << "<model_name>"
Expand Down
3 changes: 1 addition & 2 deletions Vitis-AI-Library/facefeature/test/test_compare_l64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ static float feature_dot(const int8_t *f1, const int8_t *f2) {
return (float)dot;
}

float feature_compare(const int8_t *feature, const int8_t *feature_lib,
float fuck = 0) {
float feature_compare(const int8_t *feature, const int8_t *feature_lib) {
float norm = feature_norm(feature);
float feature_norm_lib = feature_norm(feature_lib);
return feature_dot(feature, feature_lib) * norm * feature_norm_lib;
Expand Down

0 comments on commit cf5f709

Please sign in to comment.