InspireFaceInspireFace1.2.4.d10
Home
Get started
Get and build the SDK
Examples
  • English
  • 简体中文
GitHub
Home
Get started
Get and build the SDK
Examples
  • English
  • 简体中文
GitHub
  • Introduction
  • Get started
  • Features
  • Guides

    • Architecture and lifetime
    • Model packs
    • Image inputs and coordinates
    • Sessions and tracking
    • Face analysis
    • Recognition and FeatureHub
    • Facial landmarks
    • Liveness detection
    • Face capture
    • More API recipes
  • Language and platform

    • C API
    • C++
    • Python
    • Java
    • Windows
    • Android
    • Apple
    • iOS
    • macOS
    • HarmonyOS
  • Get and build the SDK

    • Overview and downloads
    • Source and common options
    • Linux
    • Windows
    • macOS
    • Android
    • iOS
    • HarmonyOS
    • NVIDIA TensorRT
    • Rockchip NPU
    • Python packaging
    • Java packaging
  • Hardware deployment

    • x86 CPU
    • ARM
    • NVIDIA TensorRT
    • Rockchip NPU
    • Python on Rockchip
  • InspireCV
  • Complete examples
  • API coverage
  • Performance
  • Image processing benchmarks
  • Troubleshooting

macOS

Use Objective-C or Swift for an AppKit / SwiftUI application, or retain the C/C++ interface in an existing native program. The Apple SDK ships the same wrapper API as iOS and can package Apple Silicon and Intel in one macOS framework slice.

JVM applications use the JAR and matching .dylib libraries; see Java integration.

See Build for macOS for architecture selection, CPU / CoreML builds and command-line checks. The Objective-C and Swift guide contains the complete file-detection example and shared ownership rules.

Select the package

AppFrameworks
Objective-C / Objective-C++InspireFace.framework or InspireFace.xcframework.
SwiftBoth InspireFace and InspireFaceSwift from the same build.
Existing C/C++ consumerKeep the raw headers and library route, or use the core framework's C header.

Download inspireface-apple-1.2.4.zip for the CPU SDK. It includes both interfaces and a universal macOS framework slice. The macOS binaries have these minimum system versions:

ArchitectureMinimum OSRaw SDK directory
arm64macOS 14.0SDKs/macosx-arm64/
x86_64macOS 15.0SDKs/macosx-x86_64/

Use the two XCFrameworks at the package root, or the merged frameworks in Frameworks/macosx/. C/C++ applications can use InspireFace/include/ and InspireFace/lib/ within the matching raw SDK directory. Models are downloaded separately.

For CoreML or a custom deployment target, follow Build for macOS. CPU and CoreML packages use the same module names and cannot be linked together.

Link and embed in Xcode

The macOS InspireFace.framework and InspireFaceSwift.framework are dynamic. Add the required XCFrameworks or macOS frameworks to the app target and select Embed & Sign. Preserve their Versions/ layout when copying them manually. The CPU inference dependency is already linked into the core framework.

SettingConfiguration
Framework Search PathsDirectory containing the macOS frameworks when using them directly.
Runpath Search PathsInclude @executable_path/../Frameworks for a standard macOS app bundle.
Other Linker FlagsRetain $(inherited); -ObjC also works with the Apple framework integration.
App architectureMatch the installed framework; include both slices for a universal application.
Deployment targetAt least the minimum recorded for every selected slice.

Do not add a raw libInspireFace alongside the framework in the same executable. For a command-line tool, place the frameworks in its deployed layout and set a matching @rpath; a path into the SDK build cache is not a distributable runtime dependency.

Model files and the sandbox

For a bundled model, add Pikachu to Copy Bundle Resources and use Bundle.main.path(forResource:ofType:) or NSBundle to get its path. For an updateable model, copy or download it into the application's Application Support directory before launch. A command-line tool can accept an absolute model path as an argument.

If a sandboxed app opens a user-selected image, obtain access through the app's document or file-selection flow, and keep any security-scoped access active until the SDK has finished reading the file. Run model loading and detection on a worker queue; publish copied geometry to the main queue for drawing.

1 · Resolve filesLocate the model and obtain access to the image.
2 · InitializeLaunch the runtime and reuse a face session.
3 · ProcessTrack, then read features or pipeline results.
4 · PresentCopy values for the UI and release frame resources.

The complete detection function runs unchanged on macOS. It uses Foundation and the SDK modules, so it does not require UIKit or a custom Swift bridge.

Camera and pixel input

An AVFoundation video-data callback supplies a CMSampleBuffer; obtain its image with CMSampleBufferGetImageBuffer. The pixel-buffer example accepts tightly packed BGRA, RGBA, gray and contiguous NV12 buffers. If the camera adds row padding, use the complete BGRA row-copy helper.

Add NSCameraUsageDescription to the app's Info settings. For an app with App Sandbox enabled, enable the Camera capability as well. Request user authorization before opening the capture device.

Use one serial analysis queue and one tracking session per stream. Limit queued frames, and avoid passing borrowed face pointers to another task or queue. AppKit's display coordinates, including a view's flipped state, need their own transform from the image coordinates.

CoreML and runtime diagnostics

Use the CoreML build with a matching Apple model pack when evaluating Apple acceleration. Intel and Apple Silicon provide different hardware; selecting the Neural Engine mode does not imply that an Intel Mac has one. See CoreML runtime modes for mode selection.

Record the SDK version, architecture, model pack and backend with a performance result. IFDiagnostics / InspireFaceDiagnostics provides version and component information; diagnostic recipes show how to query it. Test the final signed application on each supported architecture, in addition to compiling the framework.

Edit this page
Last Updated:: 9/29/26, 5:08 PM
Contributors: Jingyu
Prev
iOS
Next
HarmonyOS