Serious Problems with Face Recognition in C#

Serious Problems with Face Recognition in C#

1. Serialize() method of  Model object takes a byte arry as input. Mind it, it is not ref or out parameter. It is impossible to know actual size of the object. So it is highly difficult to declare a byte array of appropriate size. I checked even with size 10,000, after Serializing() the array still remains bytes with 0.

2. sts of Compare function is always returning  STATUS_UNAVAILABLE 

3. There is no Deserialize() method.

Somebody from dev team please clarify this. 

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

We will investigate your issue and will be back to you soon. Thanks!

The size of the buffer is returned from QueryProfile. See ProfileInfo.modelSize.

There are two ways you can create the model: CreateModel and DeserializeModel from the Recognition interface. The former is used to create a model from the current image. The later is to recreate a model from a saved buffer (Serialize).

Thanks Xintian for information.

1) I dont know about others, but here in my code when I am trying to get modelSize by Querying Profile I am getting size is 0. Below is my code.

private void SaveUserImage(PXCMImage image)
PXCMFaceAnalysis.Recognition.ProfileInfo frpinfo;
PXCMFaceAnalysis.Recognition frecog= (PXCMFaceAnalysis.Recognition)faceAnalysis.DynamicCast(PXCMFaceAnalysis.Recognition.CUID);
frecog.QueryProfile(out frpinfo);
frecog.SetProfile(ref frpinfo);
PXCMFaceAnalysis.Recognition.Model model = CreateModelFromImage(image);
byte[] modelBuffer = new byte[frpinfo.modelSize];
pxcmStatus status = model.Serialize(modelBuffer);

Is there any issue with code. I am calling this method from OnImage override method to just test it. Here both image and faceAnalysis objects are not null.

2) I agree with Rupam, it should be ref only as size we are getting from profile.

3) How can I convert a normal png or jpeg image into PXCMImage object?

Keen to hear from you.


Leave a Comment

Please sign in to add a comment. Not a member? Join today