deepinsight / deepinsight/insightface

C + + face alignment

Open
#2,120 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

// s = d[dim - 1]
// d[dim - 1] = -1
// T[:dim, :dim] = np.dot(U, np.dot(np.diag(d), V))
// d[dim - 1] = s
1. int s = d.at(dim - 1, 0) = -1;
2. d.at(dim - 1, 0) = -1;

3. T.rowRange(0, dim).colRange(0, dim) = U * V;
4. cv::Mat diag_ = cv::Mat::diag(d);
5. cv::Mat twp = diag_ * V; // np.dot(np.diag(d), V.T)
6. cv::Mat B = cv::Mat::zeros(3, 3, CV_8UC1);
7. cv::Mat C = B.diag(0);
8. T.rowRange(0, dim).colRange(0, dim) = U * twp;
9. d.at(dim - 1, 0) = s;

I think there is some bug and meaningless code, should it be the following code

1. int s = d.at(dim - 1, 0);
2. d.at(dim - 1, 0) = -1;
4. cv::Mat diag_ = cv::Mat::diag(d);
5. cv::Mat twp = diag_ * V;
8. T.rowRange(0, dim).colRange(0, dim) = U * twp;
9. d.at(dim - 1, 0) = s;

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.