Skip to content

About

Conversion of Google Mediapipe cocoa lib to SPM

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

SwiftTasksVision

SwiftTasksVision is a Swift package that facilitates the integration of Google's MediaPipe Vision solutions into your iOS applications. By adding this package as a dependency, you can seamlessly access MediaPipe's powerful vision APIs without the need for CocoaPods.

Disclaimer: This project is an independent endeavor and is not affiliated with Google.

Features

  • Swift Package Integration: Simplify your project setup by integrating MediaPipe Vision through Swift Package Manager.
  • Example Application: Includes an adapted version of Google's original example app, showcasing integration via Swift Package Manager instead of CocoaPods.
  • Automatic Package Update: On a daily basis the package is updated by a GitHub Action (if needed) and tracks the MediaPipe Vision Task Pods versioning.

Installation

To integrate MediaPipeTasksVision into your Xcode project using this package:

  1. Add Package Dependency:

    • Open your project in Xcode.
    • Navigate to File > Add Packages....
    • Enter the repository URL for SwiftTasksVision.
    • Select the desired version and add the package.
  2. Import and Use:

    • In your Swift files, finally import MediaPipeTasksVision:
      import MediaPipeTasksVision
    • Utilize MediaPipe's Vision APIs as documented.

Example Application

The package includes an adjusted example application (originally from Google) demonstrating real-time pose detection using MediaPipe Vision. This serves as a practical reference for integrating and utilizing the APIs in your projects.

About MediaPipe Vision

MediaPipe is a cross-platform framework by Google that offers customizable machine learning solutions for live and streaming media. The Vision component provides state-of-the-art models and tools for tasks such as object detection, face detection, and more.

For detailed information and documentation, refer to the MediaPipe Tasks Guide.

License

This project is licensed under the MIT License.


Note: MediaPipe is a trademark of Google. This project is not affiliated with or endorsed by Google.

Face measurement resources

The SwiftTasksVision product includes the FaceMeasurement module and its face_landmarker.task model. Both live measurement and video validation load the model automatically from SwiftTasksVision_FaceMeasurement.bundle; host apps do not need a separate model copy.

When distributing a framework that statically links this product, embed SwiftTasksVision_FaceMeasurement.bundle inside that framework. The loader checks the containing framework first and uses Swift Package Manager's resource lookup for source integrations.

Runtime dependency for prebuilt SDKs

MediaPipeRuntime exposes only MediaPipeCommonGraphLibraries.xcframework. Use this product when a prebuilt SDK already contains the MediaPipe wrappers and measurement code but dynamically links MediaPipeCommonGraphLibraries.framework.

.product(name: "MediaPipeRuntime", package: "MediapipeSwiftPackage")

This product does not include the Swift wrappers, FaceMeasurement, or their resources. The SDK must already contain the code and resources it needs. The runtime framework requires iOS 16.6 or later.

The existing SwiftTasksVision product retains its -ObjC linker flag. That target is outside the runtime product's dependency graph, so consumers of MediaPipeRuntime can use a version requirement without pulling in unsafe build settings. Publish this product in version 1.0.1 before updating downstream packages to require that version.

About

Conversion of Google Mediapipe cocoa lib to SPM

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages