@@ -137,16 +137,53 @@ DefaultPreference is the example of package in this documentation,you can freely
137137
138138 // Add an event listener to receive the data
139139 useEffect( ()=> {
140- const dataListener = eventEmitter.addListener(' FaceDetectedEvent' , async (params) => {
141- //Do something here,e.g.
142- const facetoken = params.faceToken;
143- });
140+ const dataListener = eventEmitter.addListener(' FaceDetectedEvent' , async (params) => {
141+ //Do something here,e.g.
142+ const faceToken = params.faceToken;
143+ //List of data:
144+ //faceToken //use to get image/as an id to recognize a person identidy
145+ //trackID //ID number of tracking ,for reference
146+ //searchScore //percentage it match the detected face
147+ //searchThreshold //percentage required for the application to say the face match the detected face
148+ //hairType //0-5,BALD, LITTLE_HAIR, SHORT_HAIR, LONG_HAIR, UNKNOWN, INVALID
149+ //beardType //0-4, NO_BEARD, MOUSTACHE, WHISKER, UNKNOWN, INVALID
150+ //hatType //0-4, NO_HAT, SAFETY_HELMET, OTHERS, UNKNOWN, INVALID
151+ //respiratorType //0-4, COVER_MOUTH_NOSE, COVER_MOUTH, NO_RESPIRATOR, UNKNOWN, INVALID
152+ //glassesType //0-4, NO_GLASSES, GLASSES_WITH_DARK_FRAME, GLASSES_OTHERS, UNKNOWN, INVALID
153+ //skinColorType //0-4, YELLOW, WHITE, BLACK, BROWN, INVALID
154+ });
144155
145156 const stopListener = eventEmitter.addListener(
146157 ' FaceDetectedEndEvent' , async () => {
147158 //Do something after recognition such as remove the result view
148159 }
149160 )
161+ const unknownFaceListener= eventEmitter.addListener(
162+ ' UnknownFaceDetectedEvent' ,
163+ async(params) => {
164+ //Do something here,e.g.
165+ const image=params.image;
166+ //List of data:
167+ //image //image in base64 format
168+ //trackID //ID number of tracking ,for reference
169+ //searchScore //percentage it match the detected face , //may not available if no face in local group
170+ //searchThreshold //percentage required for the application to say the face match the detected face, //may not available if no face in local group
171+ //hairType //0-5,BALD, LITTLE_HAIR, SHORT_HAIR, LONG_HAIR, UNKNOWN, INVALID
172+ //beardType //0-4, NO_BEARD, MOUSTACHE, WHISKER, UNKNOWN, INVALID
173+ //hatType //0-4, NO_HAT, SAFETY_HELMET, OTHERS, UNKNOWN, INVALID
174+ //respiratorType //0-4, COVER_MOUTH_NOSE, COVER_MOUTH, NO_RESPIRATOR, UNKNOWN, INVALID
175+ //glassesType //0-4, NO_GLASSES, GLASSES_WITH_DARK_FRAME, GLASSES_OTHERS, UNKNOWN, INVALID
176+ //skinColorType //0-4, YELLOW, WHITE, BLACK, BROWN, INVALID
177+ }
178+ )
179+
180+ return () => {
181+ // Clean up and remove event listeners
182+ dataListener.remove ();
183+ stopListener.remove ();
184+ unknownFaceListener.remove ();
185+ };
186+
150187 },[])
151188 return (
152189 < FacePassViewManager
@@ -332,51 +369,7 @@ DefaultPreference is the example of package in this documentation,you can freely
332369 setDefaultGroupName(" your_group_name" )
333370` ` `
334371
335- - initData
336- ` ` ` sh
337- const json = {
338- rcAttributeAndOcclusionMode: rcAttributeAndOcclusionMode, //0-5,whole number,Default:1
339- searchThreshold: searchThreshold, //0-100,Default:69
340- livenessThreshold: livenessThreshold, //0-100,Default:55
341- livenessEnabled: livenessEnabled, //true,false,Default:true
342- rgbIrLivenessEnabled: false, //Currently only can false
343- poseThresholdRoll: poseThresholdRoll, //0-90,Default:35
344- poseThresholdPitch: poseThresholdPitch, //0-90,Default:35
345- poseThresholdYaw: poseThresholdYaw, //0-90,Default:35
346- blurThreshold: blurThreshold, //0-1,Default:0.8
347- lowBrightnessThreshold: lowBrightnessThreshold, //0-255,Default:30
348- highBrightnessThreshold: highBrightnessThreshold, //0-255,Default:210
349- brightnessSTDThreshold: brightnessSTDThreshold, //0-255,Default:80
350- faceMinThreshold: faceMinThreshold, //0-512,whole number,Default:100
351- retryCount: retryCount, //1-unlimited,whole number,Default:2
352- smileEnabled: smileEnabled, //true/false,Default:false
353- maxFaceEnabled: maxFaceEnabled, //true/false,Default:true
354- FacePoseThresholdPitch: FacePoseThresholdPitch, //0-90,Default:35
355- FacePoseThresholdRoll: FacePoseThresholdRoll, //0-90,Default:35
356- FacePoseThresholdYaw: FacePoseThresholdYaw, //0-90,Default:35
357- FaceBlurThreshold: FaceBlurThreshold, //0-255,Default:0.7
358- FaceLowBrightnessThreshold: FaceLowBrightnessThreshold, //0-255,Default:70
359- FaceHighBrightnessThreshold: FaceHighBrightnessThreshold, //0-255,Default:220
360- FaceBrightnessSTDThreshold: FaceBrightnessSTDThreshold, //0-255,Default:60
361- FaceFaceMinThreshold: FaceFaceMinThreshold, //0-512,whole number,Default:100
362- FaceRcAttributeAndOcclusionMode: FaceRcAttributeAndOcclusionMode, //whole number //0-5,Default:2
363- }
364372
365- try{
366- await initData(json)
367- }catch(e){
368-
369- }
370- //Recommended value
371- try{
372- await initData({
373- " rcAttributeAndOcclusionMode" :1," searchThreshold" :69," livenessThreshold" :55," livenessEnabled" :false," rgbIrLivenessEnabled" :false," poseThresholdRoll" :35," poseThresholdPitch" :35," poseThresholdYaw" :35," blurThreshold" :0.8," lowBrightnessThreshold" :30," highBrightnessThreshold" :210," brightnessSTDThreshold" :80," faceMinThreshold" :100," retryCount" :2," smileEnabled" :false," maxFaceEnabled" :true," FacePoseThresholdPitch" :35," FacePoseThresholdRoll" :35," FacePoseThresholdYaw" :35," FaceBlurThreshold" :0.7," FaceLowBrightnessThreshold" :70," FaceHighBrightnessThreshold" :220," FaceBrightnessSTDThreshold" :60," FaceFaceMinThreshold" :100," FaceRcAttributeAndOcclusionMode" :2
374- })
375- }catch(e){
376-
377- }
378-
379- ` ` `
380373
381374- cameraSetting ();
382375` ` ` sh
@@ -421,7 +414,7 @@ GROUP_NAME_NOT_EXIST_ERROR // group with the provided group name is not exist
421414GET_LOCAL_GROUP_INFO_ERROR // fail to get group info,probably the provided group not exist
422415FACE_UNBIND_SUCCESS // Successfully unbind the face from group
423416FACE_UNBIND_FAILED // Fail to unbind face from group
424- EMPTY_LOCAL_GROUP_ERROR // No local group found
417+ EMPTY_LOCAL_GROUP_ERROR // No local group found in the application.
425418EMPTY_GROUP_INPUT_ERROR // No group anme provided
426419GROUP_CREATION_SUCCESS //Success in group creation
427420GROUP_CREATION_FAILED //Fail to create group
0 commit comments