Sample applicationr C# about face location, landmarks and attributes

Sample applicationr C# about face location, landmarks and attributes

Hi all,

here I leave a sample application that might be useful for the people implementing a solution in C#, it uses Intel Perceptual SDK to perform face location/detection (including confidence), landmarks detection (location of eyes, mouth, nose) and face attributes (age, emotion, eye status, gender).

Known issues and limitations:

  • There is an error when closing the app, MemoryAccessViolation, tried some solutions, still no luck.
  • It does not performs gesture recognition (the gestures of the hand like thumb-up, thumb-down, etc), this procedures requiere depth detection and I don't own an Intel camera.
  • Profile information is changed every time on OnNewFrame event, some have pointed that this is not needed and can be done once, I haven't tried yet.
  • The SDK can't detect left eye closed and right eye closed separately, it only detects when both eyes are closed, ¿SDK bug maybe?

Feel free to use it/modify, if you find a solution/improvement to the errors described above it would be cool to see the solution.

AttachmentSize
Downloadapplication/zip perceptual-csharp-demo-v5.zip16.62 KB
31 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Could you provide more detail info so we can help you to figure out? Thanks, David

Hi David,

thanks for asking, actually the post is more a "collaboration" of a sample code that might be useful for the people attempting to perform face location, landmarks detection and face attributes with the UtilMPipeline on C# on a Windows Form.

I noticed that there were a few questions related to this on the forum.

Thanks, Alex.

Update:

Here is version 6 with some References issues solved. Here I leave an image of the features:

By the way: Is there a way to change the title of the post?

del Rio - I don't see a way to change the title either.  I guess you should just start a new thread.  

Bob Davies

it is possible to get other emotion than smile from PXCMFaceAnalysis.Attribute ?

Hi Zeeshan,

there are no other emotions than Smile at the time, the programming structure leaves space for that so I guess other attributes will be added.

NOTE: Here is the latest version of the sample application shown above as the later one didn't uploaded.

Attachments: 

AttachmentSize
Downloadapplication/zip perceptual-csharp-demo-v6.zip13.13 KB

Hello! I downloaded your project, but do not compile.Added the lib pxcclr but can not find the class Attribute. What version of pxcclr are you using?

The attributes has been removed at current release(PerC SDK 2013 R2).

Hi Marcelo Q.

I just realized that the new version of the SDK does not contain the class "attribute" I don't know why. I leave you here the libpxcclr.dll that I am using (version 1.0.7383.0) please note that I don't know the reasons behind the removal of these features, so ask first if it is fine to develop a submission using this library version.

David Lu, ¿may we know why the attributes were removed? It works pretty well, smile recognition works perfectly, the "eye_closed" works too, (although they only show when both eyes are closed). Age detection works well I think. There are a very large quantity of applications that could be done with these features alone.

Greetings.

Attachments: 

AttachmentSize
Downloadapplication/zip libpxcclr.zip165.09 KB

Thanks! It really works very well! I looked in the manual and found no label like "EYE_CLOSED". Just only labels like these: LABEL_LEFT_EYE_OUTER_CORNER, LABEL_LEFT_EYE_INNER_CORNER.. I don't understand  the removal of these features...

Hello can anyone help me find a sample program in C# for hand gestures

Hello can anyone help me find a sample program in C# for hand gestures??... 

Thanks in advance

Ansh

You can find under \Program Files (x86)\Intel\PCSDK\framework\CSharp\gesture_viewer.cs

Hello david,

I tried to create a sample application for gesture recognition but when i run this nothing happens (even the camera doesn't start) it starts for speech example i created using the pdf sample.

i have attached the Program.cs file (i m doing a console sample) . what am i doing wrong here? please help

Thanks, 

Ansh

Attachments: 

AttachmentSize
Downloadapplication/zip program.zip598 bytes

Great work Del Rio with the sample.

The crash on close is just because you need to wait a short while after disposing everything before allowing the app to close or it causes a memory overflow in the SDK (hopefully that will get cleared up in future releases)

Just published my own C# sample which also uses MonoGame which shows how to use each of the SDK libs, just waiting for the posts with the links to be moderated.

Hi , guys

I created a test  application for gesture recognition but when , i run try to deploy the app, nothing happens (even the camera doesn't initiates)
But when i do the same thing for a test app for speech , it works .

Where exactly i am going wrong..
Please help

i have attached the Program.cs file (i  written a console app) . what am i doing wrong here? please help

Attachments: 

AttachmentSize
Downloadapplication/zip test-gesture-app.zip598 bytes

Hello,

I tried to extract the gist of gesture recognition sample and created a new console application... below is the main method:

but pipe line doesn't initiate (i.e. pp.init() returns false see below) ... what could be the issue... anyone please help... ASAP!!

Thanks in advance 

class Program
{
public static PXCMGesture.GeoNode[][] nodes = new PXCMGesture.GeoNode[2][] { new PXCMGesture.GeoNode[11], new PXCMGesture.GeoNode[11] };
public static PXCMGesture.Gesture[] gestures = new PXCMGesture.Gesture[2];
static void Main(string[] args)
{
Console.WriteLine("Gesture demo");UtilMPipeline pp = null;

pp = new UtilMPipeline();
pp.QueryCapture().SetFilter("DepthSense Device 325V2");
pp.EnableGesture("Hand/Finger Tracking and Gesture Recognition");
if (pp.Init())
{
Console.WriteLine("Streaming from camera");
long i = 0L;
while (i < 100000000)
{
if (!pp.AcquireFrame(true)) break;
if (!(pp.IsDisconnected()))
{
/* Display Results */
PXCMGesture gesture = pp.QueryGesture();
PXCMImage depth = pp.QueryImage(PXCMImage.ImageType.IMAGE_TYPE_DEPTH);
//DisplayPicture(depth, gesture); Used to display picture bitmap from BLOB
DisplayGeoNodes(gesture);
DisplayGesture(gesture);
}
pp.ReleaseFrame();
}
}

 

Try comparing your source to my sample repo here shich walks you through each of the pipelines, Ultil M is the one mostly covered (and working) 

http://software.intel.com/en-us/forums/topic/404773

Thanks for the hint @Simon J.! The bug will be fixed on newer versions. I will migrate the code to GitHub too, seems to be a better place to store the project. Also nice to see your contribution "MonoGame"! Keep up the good work!

@Ansh K. about your question, I could run the code don't know why, it may be helpful to look at the PCSDK\framework\CSharp\gesture_viewer.cs sample and build your idea over this sample.

Thanks, Alex.

@delRio

Thanks, feel free to fork my repo and add your samples / work there and send over a pull request.  Even better if everything is in one place.

Will add you as a contributor after your first pull so all can contribute

@delRio

Hi delRio, could you post your github repo link ?

Thanks

Hi Alejandro T.

sorry I was very busy with partials and completely forgot about the IPCSDK for a while. Here is the GitHub repo: https://github.com/a-delrio/IntelPerceptualSDK-WinformSample.

Cheers!

Hi guys,

first of all thanks for the code sample. We are using the code from git and trying to get attributes e.g. smile detection to work.

Code compiles and runs correctly but the value for smile always stays 0. Is there something we have missed to enable the attributes?

Gender and age don't change either. Eyes closed stays checked all the time...

Any help is highly appreciated.

Best,

Gabor

Edit: Found a fix. We were using R7 of the 2013 Intel SDK. Switched back to R3 and it works like a charm!

Let's try open source in R7 some attributes "// code attributes " open it and modify for work in R7 after rebuild to lib. can be compare both R7 with old version.

Note: installer Old version after rename folder or copy to other place after uninstaller and installer R7. you will have source both old version and new version.

hi..

i have run your program facedemo(perceptual-c sharp) but it's not work properly in my laptop.it can not show gender or any other function.i have Dell (intel core i3 processor).i work on gender recognition.

if can i run in my laptop webcam?.or if it need any other camera?pls  given solution of this problem.

Anybody knows how to rollback to R3 version? I found an offline installer and I've tried to uninstall my current version (R8), but it seems there's always something left. When I try to install R3, it says I already have a newer version installed. I would like to get the "Eyes closed" attribute and it seems to be the only way to make it work.

Quote:

del Rio wrote:

Hi Zeeshan,

there are no other emotions than Smile at the time, the programming structure leaves space for that so I guess other attributes will be added.

NOTE: Here is the latest version of the sample application shown above as the later one didn't uploaded.

Hi Del Rio! I tried running this application but its not working. I pressed the on/off button , nothing happens. Please tell me how to solve this issue?

Hi, good code!

But, what if I would extend this application for multiple faces feature detection?  How can i do? any suggestions?

Thank you for your cooperation!

Hi

The code works fine without any error. But should i install intel PCSDK? where should i download PCSDK? I tried in intel site no use.

This application will work laptop web camera or any other camera?

Please guide me how to download the PCSDK.

Looking forward your reply.

Regards

Guna

Hi

The code works fine without any error. But should i install intel PCSDK? where should i download PCSDK? I tried in intel site no use.

This application will work laptop web camera or any other camera?

Please guide me how to download the PCSDK.

Looking forward your reply.

Regards

Guna

Hi

The code works fine without any error. But should i install intel PCSDK? where should i download PCSDK? I tried in intel site no use.

This application will work laptop web camera or any other camera?

Please guide me how to download the PCSDK.

Looking forward your reply.

Regards

Guna

Leave a Comment

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