Coder Social home page Coder Social logo

natmlx / blazepalm-unity Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 1.87 MB

Hand landmark prediction with MediaPipe Hands in Unity Engine.

Home Page: https://demos.natml.ai/@natml/blazepalm-landmark

License: Apache License 2.0

C# 100.00%
computer-vision gesture-detection hand-tracking machine-learning mediapipe natml unity3d

blazepalm-unity's People

Contributors

lanreolokoba avatar olokobayusuf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blazepalm-unity's Issues

Crash in IOS Build

I am experiencing while runing natml Blaze Hand Land mark detection in IOs 6s
IOs 15.75
Unity 2021.3
Stack trace is below and memory usage is building upto 1.75 gb almost before crash
#0 0x000000010454a7c8 in ___lldb_unnamed_symbol622 ()
#1 0x000000010454a4e8 in ___lldb_unnamed_symbol617 ()
#2 0x000000010458033c in ___lldb_unnamed_symbol1168 ()
#3 0x00000001045560d8 in ___lldb_unnamed_symbol886 ()
#4 0x000000019544ca64 in Espresso::batch_metal::batch_metal(Espresso::context_metal*) ()
#5 0x00000001954a4c28 in Espresso::MPSEngine::batch::batch(Espresso::MPSEngine::context*) ()
#6 0x000000019544cbdc in std::__1::__shared_ptr_emplace<Espresso::MPSEngine::batch, std::__1::allocatorEspresso::MPSEngine::batch >::__shared_ptr_emplaceEspresso::MPSEngine::context*(std::__1::allocatorEspresso::MPSEngine::batch, Espresso::MPSEngine::context*&&) ()
#7 0x000000019594af34 in std::__1::shared_ptrEspresso::MPSEngine::batch std::__1::allocate_shared<Espresso::MPSEngine::batch, std::__1::allocatorEspresso::MPSEngine::batch, Espresso::MPSEngine::context*, void>(std::__1::allocatorEspresso::MPSEngine::batch const&, Espresso::MPSEngine::context*&&) ()
#8 0x00000001954a7b98 in Espresso::MPSEngine::context::begin_batch() ()
#9 0x0000000195426054 in EspressoLight::espresso_plan::execute_sync() ()
#10 0x000000019541d9b4 in espresso_plan_execute_sync ()
#11 0x0000000194e03958 in -[MLNeuralNetworkEngine executePlan:error:] ()
#12 0x0000000194e02de8 in -[MLNeuralNetworkEngine evaluateInputs:bufferIndex:options:error:] ()
#13 0x0000000194e08bc8 in __54-[MLNeuralNetworkEngine evaluateInputs:options:error:]_block_invoke ()
#14 0x0000000181180094 in _dispatch_client_callout ()
#15 0x000000018112d964 in _dispatch_lane_barrier_sync_invoke_and_complete ()
#16 0x0000000194e08874 in -[MLNeuralNetworkEngine evaluateInputs:options:error:] ()
#17 0x0000000194e0ac60 in __62-[MLNeuralNetworkEngine predictionFromFeatures:options:error:]_block_invoke ()
#18 0x0000000181180094 in _dispatch_client_callout ()
#19 0x000000018112d964 in _dispatch_lane_barrier_sync_invoke_and_complete ()
#20 0x0000000194e04000 in -[MLNeuralNetworkEngine predictionFromFeatures:options:error:] ()
#21 0x0000000194e0a9c4 in -[MLModel predictionFromFeatures:error:] ()

Predictor is called as
using (image)
{
try
{
if (imageFeature == null)
{
var width = image.height > image.width ? image.width : image.height;
var height = image.height > image.width ? image.height : image.width;
imageFeature = new MLImageFeature(width, height);
}
Debug.Log("Feature Size" + imageFeature.width + "," + imageFeature.height);
Debug.Log("XR Size" + image.width + "," + image.height);
MLXRExtensions.CopyFrom(imageFeature, image, true, ScreenOrientation.Portrait);
//MLImageFeature depthFeature = new MLImageFeature(Screen.width, Screen.height);
//MLXRExtensions.CopyFrom(depthFeature, depth, true, ScreenOrientation.Portrait);
var hands = pipeline.Predict(imageFeature);
//BlazePalmVisualizer.blazeInstance.aspectFitter.aspectRatio = width / height;
visualizer.Render(hands);
rgbImage = imageFeature.ToTexture();
//depthImage = depthFeature.ToTexture();
visualizer.rawImage.texture = rgbImage;
}
catch (Exception ex)
{
Debug.Log(ex);
}
}

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.