I want to use mediapipe framework for ios app.
I already read issue #364, and tried build ios_framework.
My Build file :
//////////////////////////////////////////////////////////////////
load(
"@build_bazel_rules_apple//apple:ios.bzl",
"ios_framework",
)
ios_framework(
name = "HandTracker",
hdrs = [
"HandTracker.h",
],
bundle_id = "com.myprofile.handtracking",
families = [
"iphone",
"ipad",
],
infoplists = ["Info.plist"],
minimum_os_version = 11.0,
provisioning_profile = "//mediapipe/examples/ios:provisioning_profile",
deps = [
":HandTrackingGpuAppLibrary",
"@ios_opencv//:OpencvFramework",
],
)
//////////////////////////////////////////////////////////////////
Info.plist :
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
bazel command :
//////////////////////////////////////////////////////////////////
bazel build -c opt --config=ios_arm64 mediapipe/examples/ios/handtrackinggpu:HandTracker
//////////////////////////////////////////////////////////////////
I tried build framework, But It's not working.
Framework's size is 34M and there is HandTracker, Info.plist, hand_landmark.tflite, hand_tracking_mobile_gpu.binarypb, palm_detection_labelmap.txt, palm_detection.tflite, HandTracker.h header files.
HandTracker's size is 15M.
When executed in xcode, shows "Unable to install
But this command is work very well.
bazel build -c opt --config=ios_arm64 mediapipe/examples/ios/handtrackinggpu:HandTrackingGpuApp
I get .ipa from this build command, and run it.
My system environment is Mac OS 10.15.4, Xcode Version 11.4.1 (11E503a), bazel 3.1.0, python 3.7.7.
I tried for 3 days, but it didn't work.
What did I do wrong?
Would you help me?
Thank you.
The same guy that opened that Issue actually made a repo where he has a successful attempt of doing this. You can find it here and see his BUILD file. After that you should be able to just include the resulting .framework folder in xCode and do the corresponding bridging file if you want to use it with Swift.
You can also use carthage to download and use what he did.
Thank you for snacalvo's reply!
I already find it, tried download framework and using it.
But noppefoxwolf's framework has memory leak.
noppefoxwolf's build file is same as I tried.
I don't understand why size of my framework and noppefoxwolf's framework is too different.
My framework's size is 34M, but noppefoxwolf's framework is 300M.
What is the problem?
Thank you for your kind cooperation.
Best Regards.
check this https://github.com/google/mediapipe/issues/387 to fix memory leak,
use below command to build the framework
$ bazel build -c opt --config=ios_fat --define 3D=true mediapipe/develop:HandTracker
Thank you for gogoqaz's reply!
I read issue #387
My mediapipeframework/scheduler_queue.cc file contains already this contents.
My HandTrackingGpuApp don't have memory leak.
AUTORELEASEPOOL {
if (is_open_node) {
DCHECK(!calculator_context);
OpenCalculatorNode(node);
} else {
RunCalculatorNode(node, calculator_context);
}
}
My system environment is Mac OS 10.15.4, Xcode Version 11.4.1 (11E503a)
bagel, python version is

I used below command to build the framework :

I get framework, framework's size is 28M.

But my framework not working in iOS app.
Error - Unable to install "MediaPipeHandTracking"
What did I do wrong?
you can check my fork https://github.com/gogoqaz/mediapipe
This is the HandTracker framework with newest mediapipe version (v0.7.5 I guess).
use below command to build the ios framework
bazel -c opt --config=ios_fat mediapipie/develop:HandTracker
I'm still figuring how to get the left/right information from the handedness stream.
Maybe I can upload an iOS testbed if you need.
ps. my bazel version is 2.0.0
How is Xcode version and Mac OS version?
And php version?
How is Xcode version and Mac OS version?
And php version?
Xcode: 11.4.1
macOS: 10.15.4
python: 2.7.16
Starting local Bazel server and connecting to it...
WARNING: Download from https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/7c09d15f9fcc14343343c247ebf5b8e0afe3e4aa.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 4d32debb2de7e3d0a96b59859d3effc9860f8d1d1dedc0eae8e74bef86295b26
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "4d32debb2de7e3d0a96b59859d3effc9860f8d1d1dedc0eae8e74bef86295b26"
DEBUG: Repository rules_cc instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/bazel_tools/tools/build_defs/repo/http.bzl:336:16: in
INFO: Repository local_execution_config_python instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule local_python_configure defined at:
/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/py/python_configure.bzl:275:26: in
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
INFO: Repository rules_java instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/bazel_tools/tools/build_defs/repo/http.bzl:336:16: in
ERROR: Analysis of target '//mediapipe/develop:HandTracker' failed; build aborted: Traceback (most recent call last):
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "/private/var/tmp/_bazel_ryb/1f06e6dc9abe405052af112572cc60fe/external/org_tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
INFO: Elapsed time: 280.358s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (24 packages loaded, 75 targets configured)
currently loading: @bazel_tools//tools/jdk
Fetching @local_config_cc_toolchains; fetching
Fetching @local_config_cc; fetching
you can check my fork https://github.com/gogoqaz/mediapipe
This is the HandTracker framework with newest mediapipe version (v0.7.5 I guess).
use below command to build the ios framework
bazel -c opt --config=ios_fat mediapipie/develop:HandTracker
I'm still figuring how to get the left/right information from the handedness stream.
Maybe I can upload an iOS testbed if you need.
ps. my bazel version is 2.0.0
I need iOS framework, if you can upload it, please upload.
Thank you for your kind cooperation.
you can check my fork https://github.com/gogoqaz/mediapipe
This is the HandTracker framework with newest mediapipe version (v0.7.5 I guess).
use below command to build the ios framework
bazel -c opt --config=ios_fat mediapipie/develop:HandTracker
I'm still figuring how to get the left/right information from the handedness stream.
Maybe I can upload an iOS testbed if you need.
ps. my bazel version is 2.0.0I need iOS framework, if you can upload it, please upload.
Thank you for your kind cooperation.
Thank you very much!!!
Your framework works very well, usage of cpu and memory is also very small.
Your framework is very nice framework that I want.
I hope users know a lot about your framework.
https://github.com/gogoqaz/mediapipe
I want to build the framework in my Mac OS system.
Would you help me?
Thank you for your kind cooperation.
Best Regards.
Thank you very much!!!
Your framework works very well, usage of cpu and memory is also very small.
Your framework is very nice framework that I want.
I hope users know a lot about your framework.https://github.com/gogoqaz/mediapipe
I want to build the framework in my Mac OS system.
Would you help me?Thank you for your kind cooperation.
Best Regards.
Glad to hear that, but the credit should belong to @noppefoxwolf, what I done is just upgrade the mediapipie for HandTracker.
I'm not familiar with Bazel, maybe you can downgrade your bazel to v2.0.0 and try to build framework again. This is the only thing I can tell you.
Good luck!
ios_static_framework has not copts and includes option, as i want to expose some headers not in my current dir. for example:
Build file in mediapipe/example/ios/frameworks and i want expose some headers in mediapipe/obj/heads. How to do it?
you can check my fork https://github.com/gogoqaz/mediapipe
This is the HandTracker framework with newest mediapipe version (v0.7.5 I guess).
use below command to build the ios framework
bazel -c opt --config=ios_fat mediapipie/develop:HandTracker
I'm still figuring how to get the left/right information from the handedness stream.
Maybe I can upload an iOS testbed if you need.
ps. my bazel version is 2.0.0I need iOS framework, if you can upload it, please upload.
Thank you for your kind cooperation.
@gogoqaz can you guide me about an example project where I can get to use this https://google.github.io/mediapipe/solutions/objectron#detection-and-tracking-pipeline objectron model by mediapipe in ios project? Also it will be great if there is some framework available in ios for that.
Most helpful comment
Glad to hear that, but the credit should belong to @noppefoxwolf, what I done is just upgrade the mediapipie for HandTracker.
I'm not familiar with Bazel, maybe you can downgrade your bazel to v2.0.0 and try to build framework again. This is the only thing I can tell you.
Good luck!