Eye glasses Detection

ErrorCode Trueface::SDK::detectGlasses(const TFImage &tfImage, const FaceBoxAndLandmarks &faceBoxAndLandmarks, GlassesLabel &result, float &glassesScore)

Detect whether the face in the image is wearing any type of eye glasses or not.

  • tfImage[in] the input image returned by preprocessImage().

  • faceBoxAndLandmarks[in] FaceBoxAndLandmarks returned by detectFaces() or detectLargestFace().

  • result[out] The predicted GlassesLabel for face image.

  • glassesScore[out] The glasses score for this image. This can be used for setting custom thresholds that work better for the use case. By default, we use a glasses score greater than 0.0 to determine that glasses were detected.


error code, see ErrorCode.

enum Trueface::GlassesLabel

Results from eye glasses detection.


enumerator GLASSES

There are glasses on the face.

enumerator NO_GLASSES

There are no glasses on the face.