Person Segmentation on iPhone XR with ARKit 3.0

727 Views Asked by At

The following piece of code returns false on iPhone XR even-though it person segmentation is working on XR.

ARConfiguration.supportsFrameSemantics(.personSegmentation)

I want to know if it does officially supports person segmentation and person segmentation with depth on XR. Just to point out I have got iOS 13.1.2 on the XR.

1

There are 1 best solutions below

2
On BEST ANSWER

Try this variation:

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    let config = ARWorldTrackingConfiguration()

    if ARWorldTrackingConfiguration.supportsFrameSemantics(.personSegmentationWithDepth) {
        config.frameSemantics = .personSegmentationWithDepth
    }
    arView.session.run(config)
}

And make sure that your Xcode version is 11.2.1 and iOS version is 13.2.3.