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

Unable to find Mediapipe Model File on Build #130

Closed
matttidridge opened this issue Nov 3, 2023 · 12 comments
Closed

Unable to find Mediapipe Model File on Build #130

matttidridge opened this issue Nov 3, 2023 · 12 comments
Assignees
Labels
bug Something isn't working no_active

Comments

@matttidridge
Copy link

matttidridge commented Nov 3, 2023

MediaPipe4U Version

2022.0.1

UE Version

5.1.x

UnrealEngine Type

Install From Epic Games Launcher

Platform

Windows

What happened?

MediaPipe working fine in editor, but after packaging a Windows build, it is unable to find the .tflite model files, causing MediaPipe not to run.

[2023.11.03-04.46.52:172][695]LogGStreamer: Display: Gstreamer initialization start...
 decklinkvideosrc connection=sdi mode=1080p24 video-format=1 ! videoflip method=horizontal-flip ! videoconvert ! video/x-raw,format=RGBA ! appsink name=mediapipe4u_sink
[2023.11.03-04.46.52:172][695]LogGStreamer: Display: GstPipeline: Init <MediaPipe4U>
[2023.11.03-04.46.52:178][695]LogGStreamer: Display: GstPipeline: Start <MediaPipe4U>
[2023.11.03-04.46.52:178][695]LogMediaPipeGStreamer: Display: GStreamer is started.
decklinkvideosrc connection=sdi mode=1080p24 video-format=1 ! videoflip method=horizontal-flip ! videoconvert ! video/x-raw,format=RGBA ! appsink name=mediapipe4u_sink
[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] MediaPipe builtin graph used (CPU).
[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] MediaPipe pipeline stopping...
[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] UmpPipeline::Shutdown OK
[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] MediaPipe pipeline stopped.
[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] MediaPipe graph nodes: 4

[2023.11.03-04.46.52:178][695]LogMediaPipe: Display: [MediaPipa API] Run mediapipe graph...
[2023.11.03-04.46.52:200][698]LogMediaPipe: Display: [MediaPipa API] Configure mediapipe graph succeed.
[2023.11.03-04.46.52:200][698]LogMediaPipe: Display: [MediaPipa API] Graph is ready (pollers: 0, observers: 5).
[2023.11.03-04.46.52:200][698]LogMediaPipe: Display: [MediaPipa API] enable_segmentation : bool
input_flip_horizontally : bool
input_flip_vertically : bool
input_rotation_degrees : int
model_complexity : int
refine_face_landmarks : bool
smooth_landmarks : bool
smooth_segmentation : bool
use_prev_landmarks : bool

[2023.11.03-04.46.52:200][698]LogMediaPipe: Display: [MediaPipa API] MediaPipe graph is launched.
🔥🔥🔥🔥🔥 
[2023.11.03-04.46.52:201][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/pose_detection/pose_detection.tflite
[2023.11.03-04.46.52:201][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/face_landmark/face_landmark.tflite
[2023.11.03-04.46.52:201][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/hand_landmark/hand_landmark_full.tflite
[2023.11.03-04.46.52:202][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/pose_landmark/pose_landmark_full.tflite
[2023.11.03-04.46.52:202][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/hand_landmark/hand_landmark_full.tflite
[2023.11.03-04.46.52:202][698]LogMediaPipe: Error: Unable to find mediapipe model file: mediapipe/modules/pose_detection/pose_detection.tflite
🔥🔥🔥🔥🔥 
.
.
.
[2023.11.03-04.46.52:202][698]LogMediaPipe: Error: [MediaPipa API] Failed to run mediapipe graph.
😢 
@matttidridge matttidridge changed the title Unable to fine Mediapipe Model File on Build Unable to find Mediapipe Model File on Build Nov 3, 2023
@matttidridge
Copy link
Author

UPDATE:

Works great when I manually add all of the .tflite files to [PROJECT]/Binaries/Win64/modules in the build folder.

I'm not sure why Unreal is not including them when I package the game.

@endink endink added the bug Something isn't working label Nov 4, 2023
@endink
Copy link
Owner

endink commented Nov 4, 2023

Oh......its a package bug....

@endink
Copy link
Owner

endink commented Nov 17, 2023

As a temporary solution:

Find the file Plugins/MediaPipe4U/Source/ThirdParty/mediapipe/MediapipeAPILibrary.Build.cs and modify line 40:

if (Target.Type != TargetType.Editor && Target.Platform == UnrealTargetPlatform.Android)
{
	AddDepFolder(MPDataDir);
}

change to:

if (Target.Type != TargetType.Editor)
{
	AddDepFolder(MPDataDir);
}

I haven't tested it yet, but I believe this will solve this issue.

Copy link

This issue is stale because it has been open for 15 days with no activity.

@endink
Copy link
Owner

endink commented Dec 28, 2023

same as #147

Copy link

This issue is stale because it has been open for 15 days with no activity.

Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@Amjid1234
Copy link

hi, i cant make a build. it gives unknown error.

kindly tell me how can i remove the error

@Amjid1234
Copy link

I have to present it ASAP. please let me know about the solution

@endink
Copy link
Owner

endink commented May 7, 2024

As a temporary solution:

Find the file Plugins/MediaPipe4U/Source/ThirdParty/mediapipe/MediapipeAPILibrary.Build.cs and modify line 40:

if (Target.Type != TargetType.Editor && Target.Platform == UnrealTargetPlatform.Android)
{
	AddDepFolder(MPDataDir);
}

change to:

if (Target.Type != TargetType.Editor)
{
	AddDepFolder(MPDataDir);
}

I haven't tested it yet, but I believe this will solve this issue.

After modified the Build.cs file, package the game again, issue will be solved.

@Amjid1234
Copy link

thanks for the solution. anothercounter question please dont mind.
do you have any idea that how can i upload the new model to it with having same rig and naming? will it work if i upload any model at runtime?

@endink endink mentioned this issue May 8, 2024
@endink
Copy link
Owner

endink commented May 8, 2024

thanks for the solution. anothercounter question please dont mind.
do you have any idea that how can i upload the new model to it with having same rig and naming? will it work if i upload any model at runtime?

@Amjid1234 open a new issue to discuss this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no_active
Projects
None yet
Development

No branches or pull requests

3 participants