toReason method

Reason toReason()

Implementation

Reason toReason() {
  switch (this) {
    case 'EXCEEDS_MAX_FACES':
      return Reason.exceedsMaxFaces;
    case 'EXTREME_POSE':
      return Reason.extremePose;
    case 'LOW_BRIGHTNESS':
      return Reason.lowBrightness;
    case 'LOW_SHARPNESS':
      return Reason.lowSharpness;
    case 'LOW_CONFIDENCE':
      return Reason.lowConfidence;
    case 'SMALL_BOUNDING_BOX':
      return Reason.smallBoundingBox;
    case 'LOW_FACE_QUALITY':
      return Reason.lowFaceQuality;
  }
  throw Exception('$this is not known in enum Reason');
}