Skip to content

Instantly share code, notes, and snippets.

@hietalajulius
Last active August 24, 2022 09:00
Show Gist options
  • Save hietalajulius/c3f4dd7e759012bb4a09a9d3e78697e2 to your computer and use it in GitHub Desktop.
Save hietalajulius/c3f4dd7e759012bb4a09a9d3e78697e2 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
var bufferSize: CGSize = .zero
var inferenceTime: CFTimeInterval = 0;
private let session = AVCaptureSession()
@IBOutlet weak var previewView: UIView!
var rootLayer: CALayer! = nil
private var previewLayer: AVCaptureVideoPreviewLayer! = nil
private var detectionLayer: CALayer! = nil
private var inferenceTimeLayer: CALayer! = nil
private var inferenceTimeBounds: CGRect! = nil
private var requests = [VNRequest]()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment