From 1fc9f4ea069e39ffac47b4a1ecccdca188c51285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 28 Dec 2023 20:43:42 +0100 Subject: [PATCH] Remove face rectangle detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- NextcloudTalk/NCCameraController.swift | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/NextcloudTalk/NCCameraController.swift b/NextcloudTalk/NCCameraController.swift index 709bcd5b..bc3a747f 100644 --- a/NextcloudTalk/NCCameraController.swift +++ b/NextcloudTalk/NCCameraController.swift @@ -51,7 +51,6 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate // Vision private let requestHandler = VNSequenceRequestHandler() - private var facePoseRequest: VNDetectFaceRectanglesRequest! private var segmentationRequest: VNGeneratePersonSegmentationRequest! // Metal @@ -101,10 +100,6 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate } func initVisionRequests() { - // Create a request to detect face rectangles. - facePoseRequest = VNDetectFaceRectanglesRequest() - facePoseRequest.revision = VNDetectFaceRectanglesRequestRevision3 - // Create a request to segment a person from an image. segmentationRequest = VNGeneratePersonSegmentationRequest() segmentationRequest.qualityLevel = .balanced @@ -286,7 +281,7 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate if self.backgroundBlurEnabled { // Perform the requests on the pixel buffer that contains the video frame. - try? requestHandler.perform([facePoseRequest, segmentationRequest], + try? requestHandler.perform([segmentationRequest], on: pixelBuffer, orientation: .right) @@ -333,7 +328,7 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate self.processVideoFrame(pixelBuffer, sampleBuffer) } - // MARK: MTKViewDelegate + // MARK: - MTKViewDelegate func draw(in view: MTKView) { guard let commandBuffer = metalCommandQueue.makeCommandBuffer(), @@ -383,7 +378,7 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate // Delegate method not implemented. } - // MARK: Notifications + // MARK: - Notifications func deviceOrientationDidChangeNotification() { self.deviceOrientation = UIDevice.current.orientation