FaceConfig constructor

FaceConfig({
  1. int minFaceSize = 200,
  2. double notFace = 0.6,
  3. double brightness = 40,
  4. double brightnessMax = 220,
  5. double blurness = 0.6,
  6. double occlusionLeftEye = 0.8,
  7. double occlusionRightEye = 0.8,
  8. double occlusionNose = 0.8,
  9. double occlusionMouth = 0.8,
  10. double occlusionLeftContour = 0.8,
  11. double occlusionRightContour = 0.8,
  12. double occlusionChin = 0.8,
  13. int headPitch = 20,
  14. int headYaw = 18,
  15. int headRoll = 20,
  16. double eyeClosed = 0.7,
  17. double scale = 1,
  18. int cropHeight = 640,
  19. int cropWidth = 480,
  20. double enlargeRatio = 1.5,
  21. double faceFarRatio = 0.4,
  22. double faceClosedRatio = 1,
  23. int secType = 0,
  24. bool sound = true,
  25. bool livenessRandom = true,
  26. Set<LivenessType>? livenessTypes,
})

Implementation

FaceConfig(
    {this.minFaceSize = 200,
    this.notFace = 0.6,
    this.brightness = 40,
    this.brightnessMax = 220,
    this.blurness = 0.6,
    this.occlusionLeftEye = 0.8,
    this.occlusionRightEye = 0.8,
    this.occlusionNose = 0.8,
    this.occlusionMouth = 0.8,
    this.occlusionLeftContour = 0.8,
    this.occlusionRightContour = 0.8,
    this.occlusionChin = 0.8,
    this.headPitch = 20,
    this.headYaw = 18,
    this.headRoll = 20,
    this.eyeClosed = 0.7,
    // this.cacheImageNum = 3,
    this.scale = 1,
    this.cropHeight = 640,
    this.cropWidth = 480,
    this.enlargeRatio = 1.5,
    this.faceFarRatio = 0.4,
    this.faceClosedRatio = 1,
    this.secType = 0,
    this.sound = true,
    this.livenessRandom = true,
    Set<LivenessType>? livenessTypes})
    : assert(0.1 <= notFace && notFace <= 1.0),
      assert(0 <= brightness && brightness <= 255),
      assert(0 <= brightnessMax && brightnessMax <= 255),
      assert(0 <= blurness && blurness <= 1.0),
      assert(0 <= occlusionLeftEye && occlusionLeftEye <= 1.0),
      assert(0 <= occlusionRightEye && occlusionRightEye <= 1.0),
      assert(0 <= occlusionNose && occlusionNose <= 1.0),
      assert(0 <= occlusionMouth && occlusionMouth <= 1.0),
      assert(0 <= occlusionLeftContour && occlusionLeftContour <= 1.0),
      assert(0 <= occlusionRightContour && occlusionRightContour <= 1.0),
      assert(0 <= occlusionChin && occlusionChin <= 1.0),
      assert(0 <= headPitch && headPitch <= 45),
      assert(0 <= headYaw && headYaw <= 45),
      assert(0 <= headRoll && headRoll <= 45),
      assert(0 <= eyeClosed && eyeClosed <= 1.0),
      assert(0 <= scale && scale <= 1.0),
      assert(0 < cropHeight && 0 < cropWidth),
      assert(0 <= faceFarRatio && faceFarRatio <= 1.0),
      assert(0 <= faceClosedRatio && faceClosedRatio <= 1.0),
      assert(secType == 0 || secType == 1),
      assert(livenessTypes == null || livenessTypes.length > 0) {
  this.livenessTypes = livenessTypes ?? {};
}