I hereby claim:
- I am adibcontractorcc on github.
- I am adibcontractor (https://keybase.io/adibcontractor) on keybase.
- I have a public key ASBBQhKTl4-Ki6oBbh326tn4a0h0CxxFMpVfBv_SVWsPVQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
import UIKit | |
import AVFoundation | |
import Vision | |
class LiveCaptureViewController: UIViewController { | |
public let cameraCapture = CameraCapture() | |
private var videoPreviewLayer : AVCaptureVideoPreviewLayer? | |
override func viewDidLoad() |
extension LiveCaptureHattingViewController { | |
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) | |
{ | |
takeScreenShot() | |
} | |
func takeScreenShot() | |
{ | |
guard let currentPixelBuffer = currentPixelBuffer else { | |
return |
let rect = observation.boundingBox.denormalized(newRect: self.view.frame) | |
let hatWidth = rect.size.width | |
let hatHeight = rect.size.height | |
let hatX = rect.origin.x - hatWidth/4 | |
let hatY = rect.origin.y - hatHeight | |
let hatRect = CGRect(x: hatX, y: hatY, width: hatWidth, height: hatHeight) | |
var hat : UIImageView? = nil | |
if faceNumber >= self.hats.count { |
import UIKit | |
import CoreMedia | |
import Vision | |
class LiveCaptureTaggingViewController: LiveCaptureViewController { | |
private var faceLayers = [CAShapeLayer]() | |
override func processBufferCaptured(buffer: CMSampleBuffer!, faceDetectionRequest: VNDetectFaceRectanglesRequest) { | |
DispatchQueue.main.async { [unowned self] in | |
self.faceLayers.forEach{ $0.removeFromSuperlayer() } |
import UIKit | |
import Vision | |
import CoreMedia | |
class DetectFacesViewController: UIViewController { | |
private var imageView : UIImageView? = nil | |
override func viewDidLoad() | |
{ |
#import "AppDelegate.h" | |
@interface AppDelegate () | |
@property (nonatomic, strong) dispatch_group_t dispatchGroup; | |
@end | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// Override point for customization after application launch. |