licensing changes
This commit is contained in:
parent
103b1aa99a
commit
01bffecad2
|
@ -0,0 +1,42 @@
|
||||||
|
# Visage Technologies AB
|
||||||
|
#
|
||||||
|
# License Key File
|
||||||
|
#
|
||||||
|
# This license key file is issued by Visage Technologies AB, Linkoping, Sweden
|
||||||
|
# under the terms of Visage Technologies Licensing Agreement. It is strictly
|
||||||
|
# prohibited to modify this file in any way.
|
||||||
|
#
|
||||||
|
# This license key file can be used only by the Licensee named below
|
||||||
|
# to distribute the Licensed Application named below. It is strictly
|
||||||
|
# prohibited to use this license key file for any other purpose,
|
||||||
|
# and specifically for distributing any application other
|
||||||
|
# than the Licensed Application named below.
|
||||||
|
# Furthermore, it is strictly prohibited for any party other
|
||||||
|
# than the Licensee named below to distribute this license key file.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Licensed application name: Evaluation - no commercial use permitted
|
||||||
|
#
|
||||||
|
# Licensee: Cannon Middle School - 5801 Poplar Tent Road, Concord, NC 28027
|
||||||
|
#
|
||||||
|
# This License Key is issued for: visage|SDK FULL V9.1
|
||||||
|
# Operating system(s): HTML5
|
||||||
|
# License Type: Evaluation
|
||||||
|
# Application ID(*): *
|
||||||
|
# Number of installations/licenses: 10
|
||||||
|
# Number of concurrent users: -
|
||||||
|
# Licensed URL (for web license): y2spv2.coredoes.dev
|
||||||
|
# Date of issuing: 14.11.2023.
|
||||||
|
# Expiry date of the License Key: 14.12.2023.
|
||||||
|
# Automatic license registration: Always if online
|
||||||
|
# License Key: 063-172-163-996-391-498-880-879-796-980-878
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#(*) Application ID means:
|
||||||
|
# App's bundle identifier on iOS.
|
||||||
|
# Application's package name on Android.
|
||||||
|
# Application's bundle identifier on Mac OS X.
|
||||||
|
# On Windows, Application ID is freely assigned by the application developer.
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Visage Technologies AB
|
||||||
|
#
|
||||||
|
# License Key File
|
||||||
|
#
|
||||||
|
# This license key file is issued by Visage Technologies AB, Linkoping, Sweden
|
||||||
|
# under the terms of Visage Technologies Licensing Agreement. It is strictly
|
||||||
|
# prohibited to modify this file in any way.
|
||||||
|
#
|
||||||
|
# This license key file can be used only by the Licensee named below
|
||||||
|
# to distribute the Licensed Application named below. It is strictly
|
||||||
|
# prohibited to use this license key file for any other purpose,
|
||||||
|
# and specifically for distributing any application other
|
||||||
|
# than the Licensed Application named below.
|
||||||
|
# Furthermore, it is strictly prohibited for any party other
|
||||||
|
# than the Licensee named below to distribute this license key file.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Licensed application name: Evaluation - no commercial use permitted
|
||||||
|
#
|
||||||
|
# Licensee: Cannon Middle School - 5801 Poplar Tent Road, Concord, NC 28027
|
||||||
|
#
|
||||||
|
# This License Key is issued for: visage|SDK FULL V9.1
|
||||||
|
# Operating system(s): HTML5
|
||||||
|
# License Type: Evaluation
|
||||||
|
# Application ID(*): *
|
||||||
|
# Number of installations/licenses: 10
|
||||||
|
# Number of concurrent users: -
|
||||||
|
# Licensed URL (for web license): localhost
|
||||||
|
# Date of issuing: 14.11.2023.
|
||||||
|
# Expiry date of the License Key: 14.12.2023.
|
||||||
|
# Automatic license registration: Always if online
|
||||||
|
# License Key: 289-098-022-858-883-076-746-061-783-146-760
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#(*) Application ID means:
|
||||||
|
# App's bundle identifier on iOS.
|
||||||
|
# Application's package name on Android.
|
||||||
|
# Application's bundle identifier on Mac OS X.
|
||||||
|
# On Windows, Application ID is freely assigned by the application developer.
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Visage Technologies AB
|
||||||
|
#
|
||||||
|
# License Key File
|
||||||
|
#
|
||||||
|
# This license key file is issued by Visage Technologies AB, Linkoping, Sweden
|
||||||
|
# under the terms of Visage Technologies Licensing Agreement. It is strictly
|
||||||
|
# prohibited to modify this file in any way.
|
||||||
|
#
|
||||||
|
# This license key file can be used only by the Licensee named below
|
||||||
|
# to distribute the Licensed Application named below. It is strictly
|
||||||
|
# prohibited to use this license key file for any other purpose,
|
||||||
|
# and specifically for distributing any application other
|
||||||
|
# than the Licensed Application named below.
|
||||||
|
# Furthermore, it is strictly prohibited for any party other
|
||||||
|
# than the Licensee named below to distribute this license key file.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Licensed application name: Evaluation - no commercial use permitted
|
||||||
|
#
|
||||||
|
# Licensee: Cannon Middle School - 5801 Poplar Tent Road, Concord, NC 28027
|
||||||
|
#
|
||||||
|
# This License Key is issued for: visage|SDK FULL V9.1
|
||||||
|
# Operating system(s): HTML5
|
||||||
|
# License Type: Evaluation
|
||||||
|
# Application ID(*): *
|
||||||
|
# Number of installations/licenses: 10
|
||||||
|
# Number of concurrent users: -
|
||||||
|
# Licensed URL (for web license): cdn.coredoes.dev
|
||||||
|
# Date of issuing: 14.11.2023.
|
||||||
|
# Expiry date of the License Key: 14.12.2023.
|
||||||
|
# Automatic license registration: Always if online
|
||||||
|
# License Key: 383-192-941-979-373-458-660-171-653-160-671
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#(*) Application ID means:
|
||||||
|
# App's bundle identifier on iOS.
|
||||||
|
# Application's package name on Android.
|
||||||
|
# Application's bundle identifier on Mac OS X.
|
||||||
|
# On Windows, Application ID is freely assigned by the application developer.
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Visage Technologies AB
|
||||||
|
#
|
||||||
|
# License Key File
|
||||||
|
#
|
||||||
|
# This license key file is issued by Visage Technologies AB, Linkoping, Sweden
|
||||||
|
# under the terms of Visage Technologies Licensing Agreement. It is strictly
|
||||||
|
# prohibited to modify this file in any way.
|
||||||
|
#
|
||||||
|
# This license key file can be used only by the Licensee named below
|
||||||
|
# to distribute the Licensed Application named below. It is strictly
|
||||||
|
# prohibited to use this license key file for any other purpose,
|
||||||
|
# and specifically for distributing any application other
|
||||||
|
# than the Licensed Application named below.
|
||||||
|
# Furthermore, it is strictly prohibited for any party other
|
||||||
|
# than the Licensee named below to distribute this license key file.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Licensed application name: Evaluation - no commercial use permitted
|
||||||
|
#
|
||||||
|
# Licensee: Cannon Middle School - 5801 Poplar Tent Road, Concord, NC 28027
|
||||||
|
#
|
||||||
|
# This License Key is issued for: visage|SDK FULL V9.1
|
||||||
|
# Operating system(s): HTML5
|
||||||
|
# License Type: Evaluation
|
||||||
|
# Application ID(*): *
|
||||||
|
# Number of installations/licenses: 10
|
||||||
|
# Number of concurrent users: -
|
||||||
|
# Licensed URL (for web license): cdn.e3t.cc
|
||||||
|
# Date of issuing: 14.11.2023.
|
||||||
|
# Expiry date of the License Key: 14.12.2023.
|
||||||
|
# Automatic license registration: Always if online
|
||||||
|
# License Key: 695-404-032-262-884-678-752-402-455-252-704
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#(*) Application ID means:
|
||||||
|
# App's bundle identifier on iOS.
|
||||||
|
# Application's package name on Android.
|
||||||
|
# Application's bundle identifier on Mac OS X.
|
||||||
|
# On Windows, Application ID is freely assigned by the application developer.
|
|
@ -1486,7 +1486,10 @@ function onModuleInitialized()
|
||||||
pixels = new Uint8ClampedArray(VisageModule.HEAPU8.buffer, ppixels, mWidth*mHeight*4);
|
pixels = new Uint8ClampedArray(VisageModule.HEAPU8.buffer, ppixels, mWidth*mHeight*4);
|
||||||
|
|
||||||
//set up tracker and licensing, valid license needs to be provided
|
//set up tracker and licensing, valid license needs to be provided
|
||||||
VisageModule.initializeLicenseManager(licenseName);
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
|
VisageModule.initializeLicenseManager(licenses[i]);
|
||||||
|
}
|
||||||
|
|
||||||
m_Tracker = new VisageModule.VisageTracker("Head Tracker.cfg");
|
m_Tracker = new VisageModule.VisageTracker("Head Tracker.cfg");
|
||||||
TfaceDataArray = new VisageModule.FaceDataVector();
|
TfaceDataArray = new VisageModule.FaceDataVector();
|
||||||
for (var i = 0; i < maxFacesTracker; ++i)
|
for (var i = 0; i < maxFacesTracker; ++i)
|
||||||
|
@ -1641,8 +1644,8 @@ function createWorkerAnalysis()
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
licenseName = "dev_html5.vlc"
|
let licenses = ["063-172-163-996-391-498-880-879-796-980-878.vlc", "289-098-022-858-883-076-746-061-783-146-760.vlc", "383-192-941-979-373-458-660-171-653-160-671.vlc", "695-404-032-262-884-678-752-402-455-252-704.vlc"];
|
||||||
licenseURL = "dev_html5.vlc"
|
|
||||||
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
||||||
VisageModule = {
|
VisageModule = {
|
||||||
locateFile: locateFile,
|
locateFile: locateFile,
|
||||||
|
@ -1652,7 +1655,9 @@ VisageModule = {
|
||||||
VisageModule.FS_createPreloadedFile('/', 'Head Tracker.cfg', "../../lib/Head Tracker.cfg", true, false);
|
VisageModule.FS_createPreloadedFile('/', 'Head Tracker.cfg', "../../lib/Head Tracker.cfg", true, false);
|
||||||
VisageModule.FS_createPreloadedFile('/', 'Face Detector.cfg', "../../lib/Face Detector.cfg", true, false);
|
VisageModule.FS_createPreloadedFile('/', 'Face Detector.cfg', "../../lib/Face Detector.cfg", true, false);
|
||||||
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
||||||
VisageModule.FS_createPreloadedFile('/', licenseName, licenseURL, true, false, function(){ }, function(){ alert("Loading License Failed!") });
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
|
VisageModule.FS_createPreloadedFile('/', licenses[i], licenses[i], true, false, function(){ }, function(){ console.log("Loading License " + licenses[i] + " Failed!") });
|
||||||
|
}
|
||||||
|
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
|
|
@ -73,14 +73,16 @@ self.onmessage = function (msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
licenseName = "dev_html5.vlc"
|
let licenses = ["063-172-163-996-391-498-880-879-796-980-878.vlc", "289-098-022-858-883-076-746-061-783-146-760.vlc", "383-192-941-979-373-458-660-171-653-160-671.vlc", "695-404-032-262-884-678-752-402-455-252-704.vlc"];
|
||||||
licenseURL = "dev_html5.vlc"
|
|
||||||
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
||||||
VisageModule = {
|
VisageModule = {
|
||||||
locateFile: locateFile,
|
locateFile: locateFile,
|
||||||
preRun: [function() {
|
preRun: [function() {
|
||||||
VisageModule.FS_createPreloadedFile('/', licenseName, licenseURL, true, false, function(){ }, function(){ console.log("Loading License Failed!") });
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
VisageModule.FS_createPreloadedFile('/', licenses[i], licenses[i], true, false, function(){ }, function(){ console.log("Loading License " + licenses[i] + " Failed!") });
|
||||||
|
}
|
||||||
|
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
||||||
}],
|
}],
|
||||||
|
|
||||||
onRuntimeInitialized: onModuleInitialized
|
onRuntimeInitialized: onModuleInitialized
|
||||||
|
@ -110,7 +112,9 @@ function onModuleInitialized()
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
VisageModule.initializeLicenseManager(licenseName);
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
|
VisageModule.initializeLicenseManager(licenses[i]);
|
||||||
|
}
|
||||||
m_FaceAnalyser = new VisageModule.VisageFaceAnalyser();
|
m_FaceAnalyser = new VisageModule.VisageFaceAnalyser();
|
||||||
|
|
||||||
m_faceDataArrayTrack = new VisageModule.FaceDataVector();
|
m_faceDataArrayTrack = new VisageModule.FaceDataVector();
|
||||||
|
|
|
@ -62,18 +62,21 @@ self.onmessage = function (msg) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
licenseName = "dev_html5.vlc"
|
let licenses = ["063-172-163-996-391-498-880-879-796-980-878.vlc", "289-098-022-858-883-076-746-061-783-146-760.vlc", "383-192-941-979-373-458-660-171-653-160-671.vlc", "695-404-032-262-884-678-752-402-455-252-704.vlc"];
|
||||||
licenseURL = "dev_html5.vlc"
|
|
||||||
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
var locateFile = function(dataFileName) {var relativePath = "../../lib/" + dataFileName; return relativePath};
|
||||||
VisageModule = {
|
VisageModule = {
|
||||||
locateFile: locateFile,
|
locateFile: locateFile,
|
||||||
preRun: [function() {
|
preRun: [function() {
|
||||||
VisageModule.FS_createPreloadedFile('/', licenseName, licenseURL, true, false, function(){ }, function(){ console.log("Loading License Failed!") });
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
VisageModule.FS_createPreloadedFile('/', licenses[i], licenses[i], true, false, function(){ }, function(){ console.log("Loading License " + licenses[i] + " Failed!") });
|
||||||
}],
|
}
|
||||||
|
VisageModule.FS_createPreloadedFile('/', 'NeuralNet.cfg', "../../lib/NeuralNet.cfg", true, false);
|
||||||
|
}],
|
||||||
|
|
||||||
onRuntimeInitialized: onModuleInitialized
|
onRuntimeInitialized: onModuleInitialized
|
||||||
}
|
}
|
||||||
|
|
||||||
importScripts('../../lib/visageSDK.js');
|
importScripts('../../lib/visageSDK.js');
|
||||||
importScripts('../../lib/visageRecognitionData.js');
|
importScripts('../../lib/visageRecognitionData.js');
|
||||||
|
|
||||||
|
@ -90,23 +93,25 @@ function onModuleInitialized()
|
||||||
setTimeout(onModuleInitialized, 100);
|
setTimeout(onModuleInitialized, 100);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ppixels = VisageModule._malloc(mWidth*mHeight*4);
|
ppixels = VisageModule._malloc(mWidth*mHeight*4);
|
||||||
pixels = new Uint8Array(VisageModule.HEAPU8.buffer, ppixels, mWidth*mHeight*4);
|
pixels = new Uint8Array(VisageModule.HEAPU8.buffer, ppixels, mWidth*mHeight*4);
|
||||||
|
|
||||||
alert = function(msg)
|
alert = function(msg)
|
||||||
{
|
{
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
VisageModule.initializeLicenseManager(licenseName);
|
for (let i = 0; i < licenses.length; i++) {
|
||||||
|
VisageModule.initializeLicenseManager(licenses[i]);
|
||||||
|
}
|
||||||
m_Recog = new VisageModule.VisageFaceRecognition();
|
m_Recog = new VisageModule.VisageFaceRecognition();
|
||||||
m_faceDataArray = new VisageModule.FaceDataVector();
|
m_faceDataArray = new VisageModule.FaceDataVector();
|
||||||
m_faceDataArray.push_back(new VisageModule.FaceData());
|
m_faceDataArray.push_back(new VisageModule.FaceData());
|
||||||
recogInitialized = true;
|
recogInitialized = true;
|
||||||
uniquePersonCnt = 0;
|
uniquePersonCnt = 0;
|
||||||
self.postMessage({aTopic:'initialization done'});
|
self.postMessage({aTopic:'initialization done'});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,8 +134,8 @@ function changeName(changedNames)
|
||||||
m_Recog.replaceDescriptorName(changedNames[currentName], i)
|
m_Recog.replaceDescriptorName(changedNames[currentName], i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.postMessage({aTopic: 'name changed'});
|
self.postMessage({aTopic: 'name changed'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,15 +147,15 @@ function changeName(changedNames)
|
||||||
function loadGallery()
|
function loadGallery()
|
||||||
{
|
{
|
||||||
if (recogInitialized)
|
if (recogInitialized)
|
||||||
{
|
{
|
||||||
m_Recog.loadGallery(galleryFileName, function(name, status)
|
m_Recog.loadGallery(galleryFileName, function(name, status)
|
||||||
{
|
{
|
||||||
var names = [];
|
var names = [];
|
||||||
|
|
||||||
//If gallery is empty sends an empty array, otherwise adds the name from gallery in the array.
|
//If gallery is empty sends an empty array, otherwise adds the name from gallery in the array.
|
||||||
//If there is more then one descriptor per name the name is added only once.
|
//If there is more then one descriptor per name the name is added only once.
|
||||||
if(status)
|
if(status)
|
||||||
{
|
{
|
||||||
if (m_Recog.getDescriptorCount() === 0)
|
if (m_Recog.getDescriptorCount() === 0)
|
||||||
{
|
{
|
||||||
names = [];
|
names = [];
|
||||||
|
@ -171,7 +176,7 @@ function loadGallery()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.postMessage({aTopic: 'gallery loaded', nameArray: names});
|
self.postMessage({aTopic: 'gallery loaded', nameArray: names});
|
||||||
for(var i = 0; i < names.length; i++)
|
for(var i = 0; i < names.length; i++)
|
||||||
{
|
{
|
||||||
delete names[i];
|
delete names[i];
|
||||||
|
@ -183,24 +188,24 @@ function loadGallery()
|
||||||
/**
|
/**
|
||||||
* Saves VisageFaceRecognition gallery to IndexedDB.
|
* Saves VisageFaceRecognition gallery to IndexedDB.
|
||||||
* <br/><br/>
|
* <br/><br/>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function saveGallery()
|
function saveGallery()
|
||||||
{
|
{
|
||||||
if (recogInitialized)
|
if (recogInitialized)
|
||||||
{
|
{
|
||||||
m_Recog.saveGallery(galleryFileName, function(name, status)
|
m_Recog.saveGallery(galleryFileName, function(name, status)
|
||||||
{
|
{
|
||||||
if(status)
|
if(status)
|
||||||
{
|
{
|
||||||
self.postMessage({aTopic: 'gallery saved'});
|
self.postMessage({aTopic: 'gallery saved'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all face descriptors from the VisageFaceRecognition gallery.
|
* Clears all face descriptors from the VisageFaceRecognition gallery.
|
||||||
* <br/><br/>
|
* <br/><br/>
|
||||||
* Deletes all descriptors from the gallery.
|
* Deletes all descriptors from the gallery.
|
||||||
*/
|
*/
|
||||||
|
@ -209,7 +214,7 @@ function clearGallery()
|
||||||
if (recogInitialized)
|
if (recogInitialized)
|
||||||
{
|
{
|
||||||
m_Recog.resetGallery();
|
m_Recog.resetGallery();
|
||||||
|
|
||||||
}
|
}
|
||||||
self.postMessage({aTopic:'gallery cleared'});
|
self.postMessage({aTopic:'gallery cleared'});
|
||||||
}
|
}
|
||||||
|
@ -231,7 +236,7 @@ function resetInitialization()
|
||||||
/**
|
/**
|
||||||
* Extracts the face descriptor for face recognition from an image and compares it with all descriptors in the current VisageFaceRecognition gallery.
|
* Extracts the face descriptor for face recognition from an image and compares it with all descriptors in the current VisageFaceRecognition gallery.
|
||||||
* <br/><br/>
|
* <br/><br/>
|
||||||
* Tries to recognize face based on descriptors' similarity. If the similarity is below similarityThreshold(0.65) threshold through numOfDescPerFace(5) iterations, the face is added to the gallery.
|
* Tries to recognize face based on descriptors' similarity. If the similarity is below similarityThreshold(0.65) threshold through numOfDescPerFace(5) iterations, the face is added to the gallery.
|
||||||
* If freeze gallery option is checked new face descritpors will not be added to the gallery.
|
* If freeze gallery option is checked new face descritpors will not be added to the gallery.
|
||||||
*/
|
*/
|
||||||
function trackRecognition()
|
function trackRecognition()
|
||||||
|
@ -242,12 +247,12 @@ function trackRecognition()
|
||||||
{
|
{
|
||||||
pixels[i] = imageData[i];
|
pixels[i] = imageData[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
var descriptor = new VisageModule.VectorShort();
|
var descriptor = new VisageModule.VectorShort();
|
||||||
var similarityArray = new VisageModule.VectorFloat();
|
var similarityArray = new VisageModule.VectorFloat();
|
||||||
var nameArray = new VisageModule.VectorString();
|
var nameArray = new VisageModule.VectorString();
|
||||||
var numRecFaces = 1;
|
var numRecFaces = 1;
|
||||||
|
|
||||||
//Extract the face descriptor from an image to the descriptor variable
|
//Extract the face descriptor from an image to the descriptor variable
|
||||||
var success = m_Recog.extractDescriptor(
|
var success = m_Recog.extractDescriptor(
|
||||||
m_faceDataArray.get(0),
|
m_faceDataArray.get(0),
|
||||||
|
@ -267,12 +272,12 @@ function trackRecognition()
|
||||||
//Identity is recognized successfully (similarity index is over the threshold)
|
//Identity is recognized successfully (similarity index is over the threshold)
|
||||||
//Return the name of the identity
|
//Return the name of the identity
|
||||||
if(numOfSim > 0 && similarityArray.get(0) > similarityThreshold)
|
if(numOfSim > 0 && similarityArray.get(0) > similarityThreshold)
|
||||||
{
|
{
|
||||||
resetInitialization();
|
resetInitialization();
|
||||||
recognizedName = nameArray.get(0);
|
recognizedName = nameArray.get(0);
|
||||||
descriptor.delete();
|
descriptor.delete();
|
||||||
}
|
}
|
||||||
//There are no similar faces found in the gallery, go into initialization phase
|
//There are no similar faces found in the gallery, go into initialization phase
|
||||||
//collect numOfDescPerFace(5) descriptors for the new identity and then add it to the gallery
|
//collect numOfDescPerFace(5) descriptors for the new identity and then add it to the gallery
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -304,12 +309,12 @@ function trackRecognition()
|
||||||
}
|
}
|
||||||
//There are no descriptors for the new identity, add the first one
|
//There are no descriptors for the new identity, add the first one
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
descArray.push(descriptor);
|
descArray.push(descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//If numOfDescPerFace(5) descriptors are collected assign an unique name and add them to the gallery,
|
//If numOfDescPerFace(5) descriptors are collected assign an unique name and add them to the gallery,
|
||||||
//else assign "?"
|
//else assign "?"
|
||||||
if(descArray.length >= numOfDescPerFace)
|
if(descArray.length >= numOfDescPerFace)
|
||||||
{
|
{
|
||||||
recognizedName = "Person"+(uniquePersonCnt+1).toString();
|
recognizedName = "Person"+(uniquePersonCnt+1).toString();
|
||||||
|
@ -325,8 +330,8 @@ function trackRecognition()
|
||||||
{
|
{
|
||||||
recognizedName = "?";
|
recognizedName = "?";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
similarityArray.delete();
|
similarityArray.delete();
|
||||||
nameArray.delete();
|
nameArray.delete();
|
||||||
}
|
}
|
||||||
|
@ -337,27 +342,27 @@ function trackRecognition()
|
||||||
{
|
{
|
||||||
pixels[i] = imageData[i];
|
pixels[i] = imageData[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(descArray.length > 0)
|
if(descArray.length > 0)
|
||||||
{
|
{
|
||||||
resetInitialization();
|
resetInitialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the number of descriptors from the gallery
|
//Get the number of descriptors from the gallery
|
||||||
var count = m_Recog.getDescriptorCount();
|
var count = m_Recog.getDescriptorCount();
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
var descriptor = new VisageModule.VectorShort();
|
var descriptor = new VisageModule.VectorShort();
|
||||||
var similarityArray = new VisageModule.VectorFloat();
|
var similarityArray = new VisageModule.VectorFloat();
|
||||||
var nameArray = new VisageModule.VectorString();
|
var nameArray = new VisageModule.VectorString();
|
||||||
|
|
||||||
//Extract the face descriptor for face recognition from an image
|
//Extract the face descriptor for face recognition from an image
|
||||||
m_Recog.extractDescriptor(m_faceDataArray.get(0), mWidth, mHeight, ppixels, descriptor);
|
m_Recog.extractDescriptor(m_faceDataArray.get(0), mWidth, mHeight, ppixels, descriptor);
|
||||||
|
|
||||||
//Check similarity
|
//Check similarity
|
||||||
var numOfSim = m_Recog.recognize(descriptor, 1, nameArray, similarityArray);
|
var numOfSim = m_Recog.recognize(descriptor, 1, nameArray, similarityArray);
|
||||||
|
|
||||||
//Face is recognized, send its name
|
//Face is recognized, send its name
|
||||||
if(numOfSim>0 && similarityArray.get(0)>similarityThreshold)
|
if(numOfSim>0 && similarityArray.get(0)>similarityThreshold)
|
||||||
{
|
{
|
||||||
|
@ -368,10 +373,10 @@ function trackRecognition()
|
||||||
{
|
{
|
||||||
recognizedName = "?";
|
recognizedName = "?";
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptor.delete();
|
descriptor.delete();
|
||||||
similarityArray.delete();
|
similarityArray.delete();
|
||||||
nameArray.delete();
|
nameArray.delete();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -379,4 +384,4 @@ function trackRecognition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.postMessage({aTopic:'results recieved', recognizedName : recognizedName});
|
self.postMessage({aTopic:'results recieved', recognizedName : recognizedName});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue