cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
deepg799
Explorer
Explorer
727 Views
Registered: ‎01-20-2019

Age and Gender detection using Vitis-AI Landmark application

Jump to solution

Is there any support for age and gender classification using the Vitis-AI landmark application?

I have seen the below Vitis-AI facelandmark.hpp file where they mentioned that Facelandmark model can be used for facelandmark, age and gender classification.

 

deepg799_0-1600258370952.png

 

But when I am trying to get the age and gender classification result from the landmark application it is throwing the error that the age and gender is not a member of FaceLandmark class

But by using the SDK_AI package I can able to get the age and gender classification results as well 

Just wanted to confirm is it removed from the Vitis-AI facelandmark application?

Can anyone confirm once?

 

0 Kudos
1 Solution

Accepted Solutions
jasonwu
Moderator
Moderator
620 Views
Registered: ‎03-27-2013

Hi @deepg799 ,

 

Just got cofirmation from dev contact. Yes, the age and gender support is removed from Vitis AI.

If you have particular support request for that I would suggest you to contact Xilinx FAE.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------

View solution in original post

6 Replies
jasonwu
Moderator
Moderator
682 Views
Registered: ‎03-27-2013

Hi @deepg799 ,

 

What code/reference did you refer to? And would you share the details of your code and the error message?

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
deepg799
Explorer
Explorer
673 Views
Registered: ‎01-20-2019

@jasonwu 

The below AI-sample application I used for the same.

https://github.com/Xilinx/Vitis-AI/tree/v1.2/Vitis-AI-Library/overview/samples/facelandmark

In the above application I modified the file "process_result.hpp" file as shown below"

 

 

 

 

#include <iostream>
#include <opencv2/opencv.hpp>
#include <string>

cv::Mat process_result(cv::Mat &image,
                       const vitis::ai::FaceLandmarkResult &result,
                       bool is_jpeg) {
  auto points = result.points;
  /* Modified to read the age and gender result */
  std::cout << "Age : " << result.age;
  std::cout << "Gender : " << result.gender;

  LOG_IF(INFO, is_jpeg) << "points ";                               //
  for (int i = 0; i < 5; ++i) {
    LOG_IF(INFO, is_jpeg) << points[i].first << " " << points[i].second;
    auto point = cv::Point{static_cast<int>(points[i].first * image.cols),
                           static_cast<int>(points[i].second * image.rows)};
    cv::circle(image, point, 3, cv::Scalar(255, 8, 18), -1);
  }
  return image;
}

 

 

The error I am getting is:

age and gender undefined in FaceLandMark class

0 Kudos
jasonwu
Moderator
Moderator
657 Views
Registered: ‎03-27-2013

Hi @deepg799 ,

 

According to https://github.com/Xilinx/Vitis-AI/blob/61d7fa9b0505d11bf3c80363e7747f73899ed5c9/Vitis-AI-Library/xnnpp/include/vitis/ai/nnpp/facelandmark.hpp

struct FaceLandmarkResult {
  /// Five key points coordinate, this array of <x,y> has 5 elements ,x / y is
  /// normalized relative to width / height, the value range from 0 to 1.
  std::array<std::pair<float, float>, 5> points;
};

It is expected behavior if you tried to visit a non-existent member.

Let me double check with dev team if age and gender can be supported in laster VAI SW stack.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
deepg799
Explorer
Explorer
643 Views
Registered: ‎01-20-2019

Hii @jasonwu 

thanks for your update.

yes, you are right.

But age and gender support is present for SDK_AI facelandmark application 

It will be helpful if you could confirm the same once why it is removed from the vitis-AI stack.

0 Kudos
jasonwu
Moderator
Moderator
621 Views
Registered: ‎03-27-2013

Hi @deepg799 ,

 

Just got cofirmation from dev contact. Yes, the age and gender support is removed from Vitis AI.

If you have particular support request for that I would suggest you to contact Xilinx FAE.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------

View solution in original post

deepg799
Explorer
Explorer
584 Views
Registered: ‎01-20-2019

@jasonwu 

Thanks for your valuable support.

0 Kudos