Troubleshooting Apple Vision Framework Errors

When working on the project "Analyzing a Selfie and Visualizing Its Content" from Apple's documentation, I downloaded the project and opened it in Xcode. However, I encountered the following error:

VTEST: error: perform(_:): inside 'for await result in resultStream' error: internalError("Error Domain=com.apple.Vision Code=9 \"Could not create inference context\" UserInfo={NSLocalizedDescription=Could not create inference context}")
VTEST: error: DetectFaceRectanglesRequest was cancelled.
VTEST: error: DetectFaceRectanglesRequest was cancelled.
Error Domain=com.apple.Vision Code=9 "Could not create inference context" UserInfo={NSLocalizedDescription=Could not create inference context}

How can I resolve this issue? Thanks in advance!

DetectFaceRectanglesRequest most likely is not supported on CPU and will therefore not run in the simulator. You need to run on the physical device.

Similar post here.

Troubleshooting Apple Vision Framework Errors
 
 
Q