Comments (4)
Try these methods to improve accuracy: https://github.com/Kagami/go-face#how-to-improve-recognition-accuracy
from go-face.
Thank you for the quick reply.
I read the code and I found the problem. In fact, I put an image of more than Pascal_Praud and the algorithm
` std::unordered_map<int, std::pair<int, float>> hits_by_cat;
for (int i = 0; i < len; i++) {
int idx = distances[i].first;
float dist = distances[i].second;
auto cat = cats.find(idx);
if (cat == cats.end())
continue;
int cat_idx = cat->second;
auto hit = hits_by_cat.find(cat_idx);
if (hit == hits_by_cat.end()) {
// printf("1 hit for %d (%d: %f)\n", cat_idx, idx, dist);
hits_by_cat[cat_idx] = {1, dist};
} else {
// printf("+1 hit for %d (%d: %f)\n", cat_idx, idx, dist);
hits_by_cat[cat_idx].first++;
}
}
auto hit = std::max_element(
hits_by_cat.begin(), hits_by_cat.end(),
[](const auto a, const auto b) {
auto hits1 = a.second.first;
auto hits2 = b.second.first;
auto dist1 = a.second.second;
auto dist2 = b.second.second;
if (hits1 == hits2) return dist1 > dist2;
return hits1 < hits2;
}
);`
It only works if there is the same number of images in the training. If I do that, it works.
Would you have idea for improvement?
from go-face.
This algorithm tries to improve accuracy by counting number of hits for the same category in top 10 minimal distances. You can implement some modificaton of that method (e.g. choose just the minimal distance between descriptors) or provide more samples so result would be more accurate.
Maybe we should add support to go-face for few other classify algorithms. PR would be great.
Btw, I've tried Yuha's photo you linked with example from readme and it correctly prints Yuha for me.
from go-face.
Yes it great.
I modified classify.cc by :
`
if (hit == hits_by_cat.end()) {
printf("1 hit for %d (%d: %f)\n", cat_idx, idx, dist);
hits_by_cat[cat_idx] = {1, dist};
} else {
printf("+1 hit for %d (%d: %f)\n", cat_idx, idx, dist);
hits_by_cat[cat_idx].first++;
hits_by_cat[cat_idx].second+=dist;
}
}
auto hit = std::max_element(
hits_by_cat.begin(), hits_by_cat.end(),
[](const auto a, const auto b) {
auto hits1 = a.second.first;
auto hits2 = b.second.first;
auto dist1 = a.second.second;
auto dist2 = b.second.second;
return float(hits1)/dist1 < float(hits2)/dist2;
}
);
`
It is an average of the number of hits in the distance. But it depends on datasets ;).
I'm looking if I can do a knn classification.
Thanks you
from go-face.
Related Issues (20)
- windows run : running g++ failed: exit status 1 cannot find -lblas: No such file or directory HOT 5
- How to use a face detection model with 68 feature points.
- library not work with AWS Lambda ECR
- openblas is installed on WIN10, but I still get undefined reference to `cblas_sgemm'
- Error recognizing unclassified faces.
- go get issue in ubuntu 20.04 HOT 1
- face alignment HOT 1
- Issue with go get on M1 MacOS HOT 6
- issu with install
- how to save model and load it later?
- How does Centos install dlib?
- does go face support docker or not HOT 2
- Face matching
- There is a problem, please help to look at it HOT 9
- Find similar faces?
- Option to ignore a specific folder
- SIGILL: illegal instruction HOT 5
- Opencv Image buffer
- cant run functions ("undefined 1.2"), need to update face.go? HOT 9
- got error "jpeg_mem_loader: unsupported pixel size"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-face.