Skip to content

Commit

Permalink
fix scale declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
luicfrr committed Apr 19, 2024
1 parent aedb7ee commit 2cea5b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ios/VisionCameraFaceDetector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,15 @@ public class VisionCameraFaceDetector: FrameProcessorPlugin {
let image = VisionImage(buffer: frame.buffer)
image.orientation = .up

let scaleX = if autoScale {screenBounds.size.width / CGFloat(frame.width)} else {1.0}
let scaleY = if autoScale {screenBounds.size.height / CGFloat(frame.height)} else {1.0}
var scaleX:CGFloat
var scaleY:CGFloat
if autoScale {
scaleX = screenBounds.size.width / CGFloat(frame.width)
scaleY = screenBounds.size.height / CGFloat(frame.height)
} else {
scaleX = CGFloat(1)
scaleY = CGFloat(1)
}

var facesList: [Any] = []
let faces: [Face] = try faceDetector!.results(in: image)
Expand Down

0 comments on commit 2cea5b5

Please sign in to comment.