• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hand Detection and Tracking with Unity ARFoundation and CoreML.

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/

More Repositories

1

Render-Crowd-Of-Animated-Characters

Animation Baker and Instancing for Animated Characters: Using GPU to implement large-amount animation characters rendering. The animation map for vertex shader to modify the vertex position of the mesh at runtime. Using GPU instancing to reduce draw calls.
C#
1,301
star
2

Realistic-Real-Time-Grass-Rendering-With-Unity

Realistic Real Time Grass Rendering With Unity. Using the Geometry Shader to generate millions of grass on GPU. ref:Edward Lee
C#
572
star
3

UnitySpecialEffectWithDepth

Using depth data to achieve scanning effects, x-ray effects, and shield energy field effects. Version Unity5.6 +
ShaderLab
449
star
4

Unity-Miscellaneous-Shaders

Miscellaneous Shaders in Unity, WIP(maybe?)
ShaderLab
445
star
5

Unity-Boids-Behavior-on-GPGPU

Boids behavior calculation code is modified to utilize Microsoft Direct Compute resulting significant improvements in Performance. 利用Compute Shader实现Boids模拟。
C#
229
star
6

Unity-Signed-Distance-Field-Shadow

Signed Distance Field Shadow in Unity
GLSL
122
star
7

Unity-Flip-Book-With-Shader

Unity Flip Book With Shader.利用shader实现翻页的效果。
ShaderLab
108
star
8

UsefulWeb

一些有用的网站收藏。
107
star
9

LightProbeEditor

Unity LightProbe Editor
C#
68
star
10

Stanford-Bunny-Fur-With-Unity

Using the Geometry Shader to generate fur on GPU.
ShaderLab
40
star
11

Unity3D_XMLToEgg

基于C#编写的Unity3D工具,利用反射和泛型通过读取XML文件创建新的实例并且为实例赋值。原型,具体内容需要具体配置。
C#
23
star
12

Unity_UI_Gamma

A project that solves the the UI rendering issue in the linear space.
ShaderLab
21
star
13

TTBT-Framework

可供Unity3D使用的行为树框架。TTBT is a C# framework for easily building and running behavior trees. Here, "behavior tree" refers to the technique used to control the behaviour of characters in games.
C#
19
star
14

TTUI-Framework

基于注册分发机制的Unity3D的UI消息框架,目的是便于管理消息以及和MonoBehaviour进行解耦。
C#
18
star
15

azure-openai-gpt4-voice-chatbot

Python
14
star
16

Unity3D_EggToolkit

基于C#的Unity3D小工具箱,namespace为EggToolkit.
C#
10
star
17

AzureFunction.UserCRUD

A sample CRUD project demonstrates the process of Azure Function using EntityFramework Core to operate the Azure SQL database.
C#
10
star
18

SBP_AssetBundles_Demo

Using SBP to build Assetbundles.
C#
7
star
19

VSCode-StandardHeader

VSCode-StandardHeader
TypeScript
6
star
20

Unity.DetectPneumoniaWithAzure

The world has changed due to the COVID-19 pandemic in 2020. Medical staff around the world have shown bravery and resilience in the fight against COVID-19, and some even sacrificed their lives while performing their duties. As an ordinary person, as a programmer, I also want to help. Therefore, using AI to try to help diagnose lung diseases, such as viral pneumonia, bacterial pneumonia, is an idea that I am interested in trying.
ShaderLab
5
star
21

Algorithms

一些基本算法的实现。慢慢更新中。
C#
4
star
22

pyuml

A toy project that generates UML diagrams of Python code by parsing the abstract syntax tree of the target Python code.
Python
4
star
23

Unity-Hello-Swift

This project demonstrates how to create a Swift plugin for Unity and 'automatically' calls some callback such as OnUnityPluginLoad etc.
C++
4
star
24

Awesome-Azure-Skilling

This repository is a collection of free resources and tips for those working with or learning about Azure.
3
star
25

iOS-Hybrid-Sample

iOS 9 Hybrid Sample
JavaScript
3
star
26

Unity-Test-Framework-with-UITest

Add UI Test in the Test Framework
C#
2
star
27

FanyoyBird

Flappy Bird written in cocos2d-js-v3.0-beta
C
2
star
28

CodeStripExample

C#
2
star
29

chenjd

1
star
30

AugmentedReality_Whale_Flying

C#
1
star
31

Unity3D_EggArray

Sort-of like underscore.js, but for CSharp
C#
1
star
32

PerformanceTester

Unity相关操作的性能测试
C#
1
star
33

Microsoft-Azure-Cloud-CheatSheets

The repo that stores the cheat sheets I made about Azure services.
1
star