FaceInfo constructor

FaceInfo(
  1. Map event
)

Implementation

FaceInfo(Map<dynamic, dynamic> event) {
  score = event[MetricsInfoKey.faceScore.name] ?? -1001;
  final double left = event[MetricsInfoKey.faceLeft.name] ?? -1001;
  final double top = event[MetricsInfoKey.faceTop.name] ?? -1001;
  final double right = event[MetricsInfoKey.faceRight.name] ?? -1001;
  final double bottom = event[MetricsInfoKey.faceBottom.name] ?? -1001;
  rect = Rect.fromLTRB(left, top, right, bottom);
  pitch = event[MetricsInfoKey.facePitch.name] ?? -1001;
  yaw = event[MetricsInfoKey.faceYaw.name] ?? -1001;
  roll = event[MetricsInfoKey.faceRoll.name] ?? -1001;
  final width = (event[MetricsInfoKey.frameWidth.name] ?? -1001) as num;
  final height = (event[MetricsInfoKey.frameHeight.name] ?? -1001) as num;
  imageSize = Size(width.toDouble(), height.toDouble());

  centerX = event[MetricsInfoKey.faceCenterX.name] ?? -1001;
  centerY = event[MetricsInfoKey.faceCenterY.name] ?? -1001;
  centerZ = event[MetricsInfoKey.faceCenterZ.name] ?? -1001;
}