mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Merge pull request #14876 from dkurt:fix_js_face_recognition_v2
This commit is contained in:
commit
e8ff5cac1d
@ -3,12 +3,12 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script src="utils.js" type="text/javascript"></script>
|
||||
<script async src="../../opencv.js" type="text/javascript"></script>
|
||||
<script src="../../utils.js" type="text/javascript"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var netDet = undefined, netRecogn = undefined;
|
||||
var persons = {};
|
||||
var utils = new Utils('');
|
||||
|
||||
//! [Run face detection model]
|
||||
function detectFaces(img) {
|
||||
@ -68,6 +68,7 @@ function recognize(face) {
|
||||
//! [Recognize]
|
||||
|
||||
function loadModels(callback) {
|
||||
var utils = new Utils('');
|
||||
var proto = 'https://raw.githubusercontent.com/opencv/opencv/3.4/samples/dnn/face_detector/deploy.prototxt';
|
||||
var weights = 'https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180205_fp16/res10_300x300_ssd_iter_140000_fp16.caffemodel';
|
||||
var recognModel = 'https://raw.githubusercontent.com/pyannote/pyannote-data/master/openface.nn4.small2.v1.t7';
|
||||
@ -187,7 +188,7 @@ function main() {
|
||||
};
|
||||
|
||||
// Load opencv.js
|
||||
utils.loadOpenCv(() => {
|
||||
cv['onRuntimeInitialized']=()=>{
|
||||
main();
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user