Commit d8c5bd92 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #14737 from Wenzhao-Xiang:master

parents 264679a7 3f5c85e9
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<html> <html>
<head> <head>
<script async src="../../opencv.js" type="text/javascript"></script>
<script src="../../utils.js" type="text/javascript"></script> <script src="../../utils.js" type="text/javascript"></script>
<script type='text/javascript'> <script type='text/javascript'>
var netDet = undefined, netRecogn = undefined; var netDet = undefined, netRecogn = undefined;
var persons = {}; var persons = {};
var utils = new Utils('');
//! [Run face detection model] //! [Run face detection model]
function detectFaces(img) { function detectFaces(img) {
...@@ -68,7 +68,6 @@ function recognize(face) { ...@@ -68,7 +68,6 @@ function recognize(face) {
//! [Recognize] //! [Recognize]
function loadModels(callback) { function loadModels(callback) {
var utils = new Utils('');
var proto = 'https://raw.githubusercontent.com/opencv/opencv/3.4/samples/dnn/face_detector/deploy.prototxt'; 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 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'; var recognModel = 'https://raw.githubusercontent.com/pyannote/pyannote-data/master/openface.nn4.small2.v1.t7';
...@@ -186,11 +185,16 @@ function main() { ...@@ -186,11 +185,16 @@ function main() {
document.getElementById('startStopButton').disabled = false; document.getElementById('startStopButton').disabled = false;
}; };
// Load opencv.js
utils.loadOpenCv(() => {
main();
});
</script> </script>
</head> </head>
<body onload="main()"> <body>
<button id="startStopButton" type="button" disabled="true">Start</button> <button id="startStopButton" type="button" disabled="true">Start</button>
<div id="status"></div> <div id="status"></div>
<canvas id="output" width=640 height=480 style="max-width: 100%"></canvas> <canvas id="output" width=640 height=480 style="max-width: 100%"></canvas>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment