Beispiel #1
0
        /// <summary>
        /// Set up basic properties.
        /// </summary>
        private void Setup()
        {
            rfbInput      = new RfbInput();
            landmarkInput = new LandmarkInput();

            cameraFocalLength = new Vector2(330.0f, 330.0f);
            closestDistance   = 10000.0f;
            CameraMode        = false;
            ShowDetail        = false;
            taskRunning       = false;

            openCVHelper = new OpenCVBridge.OpenCVHelper();
            drawingFace  = new DrawingFace(imageDisplayMaxWidth, imageDisplayMaxHeight);

            imageOriginalWidth  = 1;
            imageOriginalHeight = 1;

            imageInputData = new SoftwareBitmap(BitmapPixelFormat.Bgra8, FaceDetectionHelper.inputImageDataWidth, FaceDetectionHelper.inputImageDataHeight, BitmapAlphaMode.Premultiplied);

            recognizeButton.Visibility = Visibility.Collapsed;



            LoadFaceDetectionModelAsync();
            LoadFaceLandmarkModelAsync();
        }
        public async Task <RfbOutput> EvaluateAsync(RfbInput input)
        {
            binding.Bind("input", input.input);
            var result = await session.EvaluateAsync(binding, "0");

            var output = new RfbOutput();

            output.scores = result.Outputs["scores"] as TensorFloat;
            output.boxes  = result.Outputs["boxes"] as TensorFloat;
            return(output);
        }