GithubHelp home page GithubHelp logo

imclab / unity-arfoundation-handdetection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenjd/unity-arfoundation-handdetection

0.0 0.0 0.0 39.93 MB

Hand Detection and Tracking with Unity ARFoundation and CoreML.

License: Apache License 2.0

C# 93.13% C 0.56% ShaderLab 2.52% Objective-C 0.28% Swift 0.96% Objective-C++ 0.83% C++ 1.73%

unity-arfoundation-handdetection's Introduction

Unity-ARFoundation-HandDetection

GitHub GitHub language count

Note

The project used in this article is on the ForHandDetectionAndTrackingArticle branch.

The master branch is currently used for development and does not guarantee stability.

Update

Add GetNativeTexture scene to the master branch to show how to get native texture from iOS to Unity context and use this texture to implement the hand pixelate effect.

There is a video:

Unity AR Foundation Hand Detection 4

Description

This demo project shows how to enable the CoreML to work with AR Foundation in Unity.

It is based on the repo implemented on the native iOS platform by Gil Nakache.

The ARFoundation Plugin's version is 1.5.0-preview.5, you can find it inside the ARPackages folder.

For hand detection, the plugin uses the HandModel machine learning model. This model is from the same repo mentioned above inside the CoreML folder.

Version

Unity Version: 2018.3.13f1

Xcode Version: 10.2.1

iPhone 7: 12.3.1

Implemention

Import ARFoundation Plugin

For convenience, I use the local package import. This is very simple, just modify the manifest.json file in the package folder and add the local package in the project manifest.

    "com.unity.xr.arfoundation": "file:../ARPackages/com.unity.xr.arfoundation",
    "com.unity.xr.arkit": "file:../ARPackages/com.unity.xr.arkit

Create a Swift plugin for Unity

In order for C# to communicate with Swift, you need to create an object-c file as a bridge.

There is a sample. This proj demonstrates how to create a Swift plugin for Unity and print "Hello, I'm Swift" in Unity.

In the Unity-ARFoundation-HandDetection Proj, the structure of the plugins folder is as follows:

<Plugins>
  └── iOS
      ├── HandDetector
      │   ├── Native
      │   │  ├──HandDetector.swift
      │   │  └──HandDetectorBridge.mm
      │   └── Managed
      │      └──HandDetector.cs
      └── Unity

Read More

Unity AR Foundation and CoreML: Hand detection and tracking

I've written an article to describ the process for integrating CoreML and AR Foundation to detect and track the hand.

License

Licensed under Apache 2.0.

Unity Native Plugin API headers licensed under Unity Companion License, please see the header contents for details.

Unity-Chan is provided under the Unity-Chan License 2.0 terms. Please refer to the following link for information regarding the Unity-Chan License.

http://unity-chan.com/contents/guideline_en/

unity-arfoundation-handdetection's People

Contributors

chenjd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.