Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blendshape data and functionality with AR #1129

Closed
skango opened this issue Jan 24, 2024 · 7 comments
Closed

Blendshape data and functionality with AR #1129

skango opened this issue Jan 24, 2024 · 7 comments
Labels
type:support Support issue

Comments

@skango
Copy link

skango commented Jan 24, 2024

Plugin Version or Commit ID

V0.14.0

Unity Version

2022.3.11f1

Your Host OS

Windows 11

Target Platform

Android, iOS

Description

I would like to know if there is any way to get blend shape information. I want to use blendshape data to apply that to my 3D model in AR. Also can I run this without webtexture? Because I want to use this in AR and webtexture is not suitable. Maybe I can pass my own texture 2D? Can I do something like that? Please let me know, thanks!

Code to Reproduce the issue

No response

Additional Context

No response

@skango skango added the type:support Support issue label Jan 24, 2024
@skango
Copy link
Author

skango commented Jan 25, 2024

@homuler Please when you have time just tell me 1 little thing, I got blend shapes working, I just need to understand how can I pass mediapipe my own texture 2Ds instead of using webcamera? Please, this is the only thing I need to get everything working.
I am using facelandmarkrunner script to get blendshape data, I just don't know how to provide this plugin with my own textures and not webtextures. Thanks!

@skango
Copy link
Author

skango commented Jan 25, 2024

If anybody needs to get blendshapes, access it from facelandmarkrunner script at this part:
private void OnFaceLandmarkDetectionOutput(FaceLandmarkerResult result, Image image, long timestamp)
{
File.WriteAllText(Application.persistentDataPath + "/mpblend.json",
result.faceBlendshapes[0].ToString());
_faceLandmarkerResultAnnotationController.DrawLater(result);
}

@homuler
Copy link
Owner

homuler commented Jan 26, 2024

I just need to understand how can I pass mediapipe my own texture 2Ds instead of using webcamera?

You can build an Image from Texture2D.

// TODO: detect format from the texture
public Image(ImageFormat.Types.Format format, Texture2D texture) :
this(format, texture.width, texture.height, format.NumberOfChannels() * texture.width, texture.GetRawTextureData<byte>())
{ }

See also https://github.com/homuler/MediaPipeUnityPlugin/wiki/API-Overview#imageframe and #343.

@skango
Copy link
Author

skango commented Jan 26, 2024

I just need to understand how can I pass mediapipe my own texture 2Ds instead of using webcamera?

You can build an Image from Texture2D.

// TODO: detect format from the texture
public Image(ImageFormat.Types.Format format, Texture2D texture) :
this(format, texture.width, texture.height, format.NumberOfChannels() * texture.width, texture.GetRawTextureData<byte>())
{ }

See also https://github.com/homuler/MediaPipeUnityPlugin/wiki/API-Overview#imageframe and #343.

Thank you for your response, it is very clear there how to create an image frame, however, I don't understand where to pass that frame variable. facelandmarkrunner is the script I want to use only, since that one has blend shapes, so how do I input there this image frame? Or it is global? If it's global where does that go? Everything else is clear and I understand, thank you! In the sample code you pass it to some graph drawer or something, and I don't use that, I need this facelandmarkrunner.

@homuler
Copy link
Owner

homuler commented Jan 26, 2024

I mean you can build an Image from Texture2D as well as ImageFrame.

@skango
Copy link
Author

skango commented Jan 27, 2024

Okay thanks I got it working on android, however, I am not able to make IOS build, is there anything that I am missing? The Xcode project with full of errors, that was not the case before I imported this plugin. I made a build from windows machine, should I make it from MacOS? Could that be an issue?

@homuler
Copy link
Owner

homuler commented Jan 28, 2024

If necessary, please create a new issue.

@homuler homuler closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:support Support issue
Projects
None yet
Development

No branches or pull requests

2 participants