[{"id":"63368d69.d11d5c","type":"tab","label":"Advanced - face","disabled":false,"info":""},{"id":"bdc0b3ae.b9a248","type":"inject","z":"63368d69.d11d5c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":220,"wires":[["f42eabc3.f6e658"]]},{"id":"f42eabc3.f6e658","type":"file in","z":"63368d69.d11d5c","name":"","filename":".node-red/node_modules/node-red-contrib-facial-recognition/example/unknown_face/sample (1).jpg","format":"","chunk":false,"sendError":false,"encoding":"none","x":620,"y":220,"wires":[["510508cd.bc342"]]},{"id":"da4443a6.9f59d8","type":"function","z":"63368d69.d11d5c","name":"Prep rects for annotate image node","func":"//global vars\nvar the_rects;\n\n//was detectAllFaces or detectSingleFace used\n//check to see if payload.Result is an array (detectAllFaces)\nvar Result = msg.payload.Result;\nif ( Array.isArray(Result) ) {\n // get just the rect values and place in array\n the_rects = Result.map(x => {\n //check for label from FaceRecognition\n var match_label;\n if ( x.match ) {\n match_label = x.match._label;\n }\n else {\n match_label = \"\";\n }\n var result = {\n type: \"rect\",\n x: x.detection._box._x,\n y: x.detection._box._y,\n w: x.detection._box._width,\n h: x.detection._box._height,\n label: match_label\n }\n return result;\n });\n msg.annotations = the_rects;\n}\n//else detectSingleFace was used\nelse {\n //check for label from FaceRecognition\n var match_label;\n if ( Result.match ) {\n match_label = Result.match._label;\n }\n else {\n match_label = \"\";\n }\n the_rects = [{\n type: \"rect\",\n x: Result.detection._box._x,\n y: Result.detection._box._y,\n w: Result.detection._box._width,\n h: Result.detection._box._height,\n label: match_label.match._label\n }]\n msg.annotations = the_rects;\n}\n\n\n\n//var xx = msg.payload.Result[0].detection._box._x;\n//var yy = msg.payload.Result[0].detection._box._y;\n//var ww = msg.payload.Result[0].detection._box._width;\n//var hh = msg.payload.Result[0].detection._box._height;\n\n//msg.annotations = [ {\n// type: \"rect\",\n// //bbox: [ xx, yy, ww, hh],\n// x: xx, y: yy, w: ww, h: hh,\n// //bbox: [ 100, 100, 100, 100],\n// label: \"Tara Sanford\"\n//}]\n\nmsg.payload = msg.payload.OriginalBufferedImg;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":300,"wires":[["c4b929f7.c31d78"]]},{"id":"c4b929f7.c31d78","type":"annotate-image","z":"63368d69.d11d5c","name":"","fill":"","stroke":"#0070c0","lineWidth":"20","fontSize":"48","fontColor":"#0070c0","x":800,"y":300,"wires":[["1504ab31.07575d"]]},{"id":"1504ab31.07575d","type":"image","z":"63368d69.d11d5c","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":180,"y":300,"wires":[]},{"id":"1bc415e3.ed6bea","type":"debug","z":"63368d69.d11d5c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":260,"wires":[]},{"id":"510508cd.bc342","type":"facial-recognition","z":"63368d69.d11d5c","image":"payload","settings":"settings","name":"","bindings":"CPU","FaceDetector":"SsdMobilenetv1","FaceDetector_SsdMobilenetv1_maxResults":"5","FaceDetector_SsdMobilenetv1_minConfidence":"0.6","FaceDetector_tinyFaceDetector_inputSize":"416","FaceDetector_tinyFaceDetector_scoreThreshold":"0.5","Tasks":"detectAllFaces","FaceLandmarks":true,"FaceExpressions":true,"AgeAndGender":true,"FaceDescriptors":true,"Face_Recognition":"Face_Recognition_enabled","Face_Recognition_enabled_path":"FullPathToLabeledFaces","Face_Recognition_distanceThreshold":0.7,"x":190,"y":260,"wires":[["da4443a6.9f59d8","1bc415e3.ed6bea"]]},{"id":"ee417043.f6b968","type":"comment","z":"63368d69.d11d5c","name":"Recognize all faces in image","info":"","x":180,"y":100,"wires":[]},{"id":"5bc97bde.44ff3c","type":"comment","z":"63368d69.d11d5c","name":"Note: you will notice it takes longer the first time as it has to load all images","info":"","x":360,"y":140,"wires":[]},{"id":"d0d6d5db.66c4b","type":"comment","z":"63368d69.d11d5c","name":"the next time you run it it should take less time","info":"","x":270,"y":180,"wires":[]}]