private void UpdateUiSettingsValues(DeviceConfig deviceConfig, PreviewConfig previewConfig, MainWindow.FlowMode flowMode) { SecurityLevelHigh.IsChecked = deviceConfig.securityLevel == DeviceConfig.SecurityLevel.High; SecurityLevelMedium.IsChecked = deviceConfig.securityLevel == DeviceConfig.SecurityLevel.Medium; FaceSelectionPolicySingle.IsChecked = deviceConfig.faceSelectionPolicy == DeviceConfig.FaceSelectionPolicy.Single; FaceSelectionPolicyAll.IsChecked = deviceConfig.faceSelectionPolicy == DeviceConfig.FaceSelectionPolicy.All; AlgoFlow_All.IsChecked = deviceConfig.algoFlow == DeviceConfig.AlgoFlow.All; AlgoFlow_DetectionOnly.IsChecked = deviceConfig.algoFlow == DeviceConfig.AlgoFlow.FaceDetectionOnly; AlgoFlow_RecognitionOnly.IsChecked = deviceConfig.algoFlow == DeviceConfig.AlgoFlow.RecognitionOnly; AlgoFlow_SpoofOnly.IsChecked = deviceConfig.algoFlow == DeviceConfig.AlgoFlow.SpoofOnly; ServerModeNo.IsChecked = flowMode == MainWindow.FlowMode.Device; ServerModeYes.IsChecked = flowMode == MainWindow.FlowMode.Server; CameraRotation0.IsChecked = deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_0_Deg; CameraRotation180.IsChecked = deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_180_Deg; CameraRotation90.IsChecked = deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_90_Deg; CameraRotation270.IsChecked = deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_270_Deg; PreviewModeMJPEG_1080P.IsChecked = previewConfig.previewMode == PreviewMode.MJPEG_1080P; PreviewModeMJPEG_720P.IsChecked = previewConfig.previewMode == PreviewMode.MJPEG_720P; PreviewModeRAW10_1080P.IsChecked = previewConfig.previewMode == PreviewMode.RAW10_1080P; DumpModeNone.IsChecked = deviceConfig.dumpMode == DeviceConfig.DumpMode.None; DumpModeCropped.IsChecked = deviceConfig.dumpMode == DeviceConfig.DumpMode.CroppedFace; DumpModeFull.IsChecked = deviceConfig.dumpMode == DeviceConfig.DumpMode.FullFrame; }
public void Setup(AbilityPreviewer previewer, PreviewConfig previewConfig) { this.previewer = previewer; this.previewConfig = previewConfig; this.positioner = previewConfig.positioner; Initialize(); UpdateScale(true); }
public virtual void Setup(AbilityPreviewer previewer, PreviewConfig previewConfig) { this.previewer = previewer; this.previewConfig = previewConfig; PositionerTransform = new GameObject($"{GetType()}").transform; PositionerTransform.SetParent(previewer.transform); Target = new GameObject("Target").transform; Target.SetParent(PositionerTransform); }
void QueryUiSettingsValues(out DeviceConfig deviceConfig, out PreviewConfig previewConfig, out MainWindow.FlowMode flowMode) { deviceConfig = new DeviceConfig(); previewConfig = new PreviewConfig(); // securiy level deviceConfig.securityLevel = DeviceConfig.SecurityLevel.Medium; if (SecurityLevelHigh.IsChecked.GetValueOrDefault()) { deviceConfig.securityLevel = DeviceConfig.SecurityLevel.High; } // policy if (FaceSelectionPolicyAll.IsChecked.GetValueOrDefault()) { deviceConfig.faceSelectionPolicy = DeviceConfig.FaceSelectionPolicy.All; } else { deviceConfig.faceSelectionPolicy = DeviceConfig.FaceSelectionPolicy.Single; } // algo flow if (AlgoFlow_All.IsChecked.GetValueOrDefault()) { deviceConfig.algoFlow = DeviceConfig.AlgoFlow.All; } else if (AlgoFlow_DetectionOnly.IsChecked.GetValueOrDefault()) { deviceConfig.algoFlow = DeviceConfig.AlgoFlow.FaceDetectionOnly; } else if (AlgoFlow_RecognitionOnly.IsChecked.GetValueOrDefault()) { deviceConfig.algoFlow = DeviceConfig.AlgoFlow.RecognitionOnly; } else if (AlgoFlow_SpoofOnly.IsChecked.GetValueOrDefault()) { deviceConfig.algoFlow = DeviceConfig.AlgoFlow.SpoofOnly; } // camera rotation if (CameraRotation0.IsChecked.GetValueOrDefault()) { deviceConfig.cameraRotation = DeviceConfig.CameraRotation.Rotation_0_Deg; } else if (CameraRotation90.IsChecked.GetValueOrDefault()) { deviceConfig.cameraRotation = DeviceConfig.CameraRotation.Rotation_90_Deg; } else if (CameraRotation270.IsChecked.GetValueOrDefault()) { deviceConfig.cameraRotation = DeviceConfig.CameraRotation.Rotation_270_Deg; } else if (CameraRotation180.IsChecked.GetValueOrDefault()) { deviceConfig.cameraRotation = DeviceConfig.CameraRotation.Rotation_180_Deg; } // flow mode flowMode = ServerModeNo.IsChecked.GetValueOrDefault() ? MainWindow.FlowMode.Device : MainWindow.FlowMode.Server; previewConfig.portraitMode = deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_0_Deg || deviceConfig.cameraRotation == DeviceConfig.CameraRotation.Rotation_180_Deg; if (PreviewModeMJPEG_1080P.IsChecked.GetValueOrDefault()) { previewConfig.previewMode = PreviewMode.MJPEG_1080P; } else if (PreviewModeMJPEG_720P.IsChecked.GetValueOrDefault()) { previewConfig.previewMode = PreviewMode.MJPEG_720P; } else if (PreviewModeRAW10_1080P.IsChecked.GetValueOrDefault()) { previewConfig.previewMode = PreviewMode.RAW10_1080P; } // dump mode if (DumpModeNone.IsChecked.GetValueOrDefault()) { deviceConfig.dumpMode = DeviceConfig.DumpMode.None; } else if (DumpModeCropped.IsChecked.GetValueOrDefault()) { deviceConfig.dumpMode = DeviceConfig.DumpMode.CroppedFace; } else if (DumpModeFull.IsChecked.GetValueOrDefault()) { deviceConfig.dumpMode = DeviceConfig.DumpMode.FullFrame; } }
public override void Setup(AbilityPreviewer previewer, PreviewConfig previewConfig) { base.Setup(previewer, previewConfig); PositionerTransform.rotation = Quaternion.identity; }