question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Pose Graph?

See original GitHub issue

I have a modified graph of Pose which I made in .pbtxt format (I made the changes in the original mediapipe repository) Now, I simply want it to run that custom graph inside this unity project. Please explain the whole procedure. @homuler

Also, I have planned to make three files of resources, Objects, and scripts inside the Assets\Mediapipe\Samples\Graphs\CustomGraph. What else to do?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
homulercommented, Sep 17, 2021

I guess it generates .bytes files instead of accessing them. (Correct me if I’m wrong)

Yes, that’s right. Some calculators will read *.tflite or .txt files on which they are dependent, so we need to save those files beforehand. cf. https://github.com/google/mediapipe/blob/ecb5b5f44ab23ea620ef97a479407c699e424aa7/mediapipe/calculators/tflite/tflite_tensors_to_classification_calculator.cc#L106

What actually are these .bytes files?

Binary files those calculators depend on, and in most cases *.tflite files. Unity does not accept arbitrary extensions for assets (cf. https://docs.unity3d.com/Manual/class-TextAsset.html), so I change extensions here. https://github.com/homuler/MediaPipeUnityPlugin/blob/92dd55579f2faeabf49338974ddb1d15ae54b683/mediapipe_api/import_model.bzl#L52-L59

When you run build.py script, dependent model files will be zipped up and extracted under Packages/com.github.homuler.mediapipe/Runtime/Resources. https://github.com/homuler/MediaPipeUnityPlugin/blob/92dd55579f2faeabf49338974ddb1d15ae54b683/mediapipe_api/BUILD#L141-L171

Do I need to generate these files at runtime corresponding to the stream name or what is the actual process?

As you inferred, you need to save dependent model files before running the graph by calling PrepareDependentAsset. Even if you can’t list them all exactly, you can usually know which files are missing by reading error logs. If some dependent files don’t exist under Packages/com.github.homuler.mediapipe/Runtime/Resources, you need to import them.

1reaction
homulercommented, Sep 10, 2021

Yes, you can use new_local_repository. https://github.com/homuler/MediaPipeUnityPlugin/issues/242#issuecomment-900249401 may be related. However, if your forked repository is also hosted by GitHub, I think changing urls at http_archive is more portable than using new_local_repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PoseMy.Art | Free tool to create reference poses with 3D ...
Create figure drawing reference with this free character posing tool. Pose 3D models with premade animations to create dynamic pose reference for your...
Read more >
Create 2-D pose graph - MATLAB
To construct a pose graph iteratively, use the addRelativePose function to add relative pose estimates and connect them to an existing node with...
Read more >
Factor Graphs and GTSAM
3.2 Defining Custom Factors ... 4.3 Reading and Optimizing Pose Graphs ... In GTSAM, you can create custom unary factors by deriving a...
Read more >
Motion Planning with Dynamic Constraints Through Pose ...
The hyper-graph structure was implemented in C++ using a custom datastructure with functionalities for adding and deleting vertices, updating weights of edges ...
Read more >
Pose-Graph-SLAM: How to create edges if only IMU- ...
I obtain a 7D pose, i.e. 3D position vector + unit quaternion orientation, if I integrate the translational acceleration twice and propagate the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found