# iOS : Computer vision only mode and processFrame

**URL:** <https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356>\
**Category:** SDK\
**Tags:** face-tracking\
**Created:** [June 29, 2023, 1:46pm UTC](https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356 "2023-06-29T13:46:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aubertB](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@aubertB](https://forum.deepar.ai/u/aubertB)\
**Post date:** [June 29, 2023, 1:46pm UTC](https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356/1 "2023-06-29T13:46:58Z")

</div>

Hello, I have a problem when I launch my iOS program.  
I’m new to swift programming, sorry if my question seems simple but I can’t find anything to solve this problem.

When I try to execute the processFrame function after DeepAr initialization, I get this error:  
Thread 1: EXC\_BAD\_ACCESS (code=1, address=0x17d)

To initialize DeepAR, I first generate a new instance of DeepAR. Then I define my license key, add the delegate and run the initialize function.

The frame that I launch to process frame exist (not nil) and I DeepAr is in isVisionOnly and the visionInitialized return true.

The error is not triggered when I use DeepAR in OffScreen. I guess I’m missing something?

```auto
    @objc public func initDeepAR(imageWidth :Int, imageHeight :Int)
    {
        deepARInstance.setLicenseKey("***")
        deepARInstance.delegate = deeparDelegate
        deepARInstance.initialize()
    }

    @objc public func proccesFrame(pointer:UnsafeMutableRawPointer,cameraFrontal:Bool)
    {
        let buffer = createPixelBufferFromTexturePointer(texturePointer: pointer )
        
        print("is vision only : " , deepARInstance.isVisionOnly(), " | ",deepARInstance.visionInitialized)
        print("Buffer exist : ",buffer != nil)

        deepARInstance.processFrame(buffer, mirror: true)
    }

```

Thanks

---

<div class="post-metadata">

**Author:** ![jelena](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/jelena/32/14_2.png) [@jelena](https://forum.deepar.ai/u/jelena)\
**Post date:** [June 30, 2023, 6:48pm UTC](https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356/2 "2023-06-30T18:48:52Z")

</div>

Hi.

What is the use case? If you have a view that should display DeepAR or is it in fact offscreen?

If it’s offscreen then that’s what should be set, if you have an ar view you should set it

```auto
    CGRect arviewrect = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
    self.arview = (ARView*)[self.deepAR createARViewWithFrame:arviewrect];
    [self.view insertSubview:self.arview atIndex:0];

```

---

<div class="post-metadata">

**Author:** ![aubertB](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@aubertB](https://forum.deepar.ai/u/aubertB)\
**Post date:** [July 3, 2023, 7:42am UTC](https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356/3 "2023-07-03T07:42:22Z")

</div>

Hi,

I’m trying to get the FaceData struct from my camera stream. The camera stream images are sent in the processFrame function and I guess I can get the FaceData struct in the faceTracked delegate

---

<div class="post-metadata">

**Author:** ![jelena](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/jelena/32/14_2.png) [@jelena](https://forum.deepar.ai/u/jelena)\
**Post date:** [July 3, 2023, 12:11pm UTC](https://forum.deepar.ai/t/ios-computer-vision-only-mode-and-processframe/356/4 "2023-07-03T12:11:04Z")

</div>

You can have an arview instead of the camera view to process in livetime, and yes you can get face data in that delegate. One note: To save resources, this callback will not be called if there is no active effect that tracks the face. I’ve attached an effect that makes no visual changes but forces the face tracking to be on

[emptyeffect.deepar.zip](https://forum.deepar.ai/uploads/short-url/9phYrp2wC4vsol1KJ4vR8fh2dsW.zip) (656 Bytes)
