questions about PXCFaceAnalysis::Attribute

questions about PXCFaceAnalysis::Attribute

Hi, I am trying to use PXCFaceAnalysis::Attribute to get some information like smile, age, etc.

Here is some part of the code:

PXCFaceAnalysis::Attribute *attr = faceAnalyzer->DynamicCast<PXCFaceAnalysis::Attribute>();
PXCFaceAnalysis::Attribute::ProfileInfo dInfo2={0};
attr->QueryProfile(PXCFaceAnalysis::Attribute::LABEL_EMOTION, &dInfo2);
attr->SetProfile(PXCFaceAnalysis::Attribute::LABEL_EMOTION, &dInfo2);

for (int fidx = 0; ; fidx++) {
pxcUID fid = 0;
pxcU64 timeStamp = 0;
sts = faceAnalyzer->QueryFace(fidx, &fid, &timeStamp);
if (sts < PXC_STATUS_NO_ERROR) break; // no more faces
pxcU32 smile;
sts = attr->QueryData(PXCFaceAnalysis::Attribute::LABEL_EMOTION,fid,&smile);
}

I notice that QueryData sometimes returns success, but sometimes returns failure. Is there anything wrong with my code? Please tell me, thanks.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I have forwarded you question to the development team and will be back to you soon.

Hi Yuan,

yes when you use pxcStatus QueryProfile(Label label, pxcU32 pidx, ProfileInfo *pinfo);  please set the pidx = profile number which is 0 in our case. otherwise the function returns the current working profile which is not set in the first place.

so do the following:  attr->QueryProfile(PXCFaceAnalysis::Attribute::LABEL_EMOTION, 0, &dInfo2);

let me know if this works,

thanks.

It performs much better!

But sometimes the sts still returns -3.

Besides, I'd like to ask that when it detects a smile, does it always return the constant 100?

yes the sts will return -3 if it can not detect the specified attribute. Sometimes a face can be detected but can not make out a decision on the attributes.

yes for the smile it returns either 0 for no detection or 100 for detection.

it is possible to get other emotion than smile from PXCFaceAnalysis::Attribute ?

Login to leave a comment.