Skip to content
Permalink
Browse files

Project import generated by Copybara.

GitOrigin-RevId: 5aca6b3f07b67e09988a901f50f595ca5f566e67
  • Loading branch information
MediaPipe Team jqtang
MediaPipe Team authored and jqtang committed Nov 15, 2019
1 parent d030c13 commit 9437483827ca26bb41949cba5c9477f604c0a6fb
Showing with 6,284 additions and 391 deletions.
  1. +1 −1 .bazelrc
  2. +4 −1 README.md
  3. +8 −23 WORKSPACE
  4. +122 −3 mediapipe/calculators/core/BUILD
  5. +335 −0 mediapipe/calculators/core/begin_end_loop_calculator_graph_test.cc
  6. +40 −0 mediapipe/calculators/core/begin_loop_calculator.cc
  7. +157 −0 mediapipe/calculators/core/begin_loop_calculator.h
  8. +26 −0 mediapipe/calculators/core/clip_detection_vector_size_calculator.cc
  9. +28 −0 mediapipe/calculators/core/clip_vector_size_calculator.cc
  10. +137 −0 mediapipe/calculators/core/clip_vector_size_calculator.h
  11. +28 −0 mediapipe/calculators/core/clip_vector_size_calculator.proto
  12. +179 −0 mediapipe/calculators/core/clip_vector_size_calculator_test.cc
  13. +45 −0 mediapipe/calculators/core/end_loop_calculator.cc
  14. +106 −0 mediapipe/calculators/core/end_loop_calculator.h
  15. +26 −5 mediapipe/calculators/core/packet_resampler_calculator.cc
  16. +2 −2 mediapipe/calculators/image/BUILD
  17. +49 −61 mediapipe/calculators/tensorflow/BUILD
  18. +1 −0 mediapipe/calculators/tflite/BUILD
  19. +4 −4 mediapipe/calculators/tflite/tflite_inference_calculator.cc
  20. +3 −13 mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.cc
  21. +138 −2 mediapipe/calculators/util/BUILD
  22. +0 −10 mediapipe/calculators/util/annotation_overlay_calculator.cc
  23. +259 −0 mediapipe/calculators/util/association_calculator.h
  24. +27 −0 mediapipe/calculators/util/association_calculator.proto
  25. +476 −0 mediapipe/calculators/util/association_calculator_test.cc
  26. +77 −0 mediapipe/calculators/util/association_detection_calculator.cc
  27. +72 −0 mediapipe/calculators/util/association_norm_rect_calculator.cc
  28. +26 −0 mediapipe/calculators/util/collection_has_min_size_calculator.cc
  29. +84 −0 mediapipe/calculators/util/collection_has_min_size_calculator.h
  30. +29 −0 mediapipe/calculators/util/collection_has_min_size_calculator.proto
  31. +34 −0 mediapipe/calculators/util/filter_collection_calculator.cc
  32. +109 −0 mediapipe/calculators/util/filter_collection_calculator.h
  33. +43 −2 mediapipe/calculators/util/rect_transformation_calculator.cc
  34. +19 −8 mediapipe/calculators/video/BUILD
  35. +1 −0 mediapipe/calculators/video/opencv_video_decoder_calculator.cc
  36. +0 −26 mediapipe/calculators/video/testdata/BUILD
  37. +4 −4 mediapipe/calculators/video/tool/BUILD
  38. +18 −0 mediapipe/docs/examples.md
  39. +1 −1 mediapipe/docs/face_detection_desktop.md
  40. +1 −3 mediapipe/docs/hair_segmentation_desktop.md
  41. +1 −1 mediapipe/docs/hair_segmentation_mobile_gpu.md
  42. +1 −5 mediapipe/docs/hand_tracking_desktop.md
  43. +2 −2 mediapipe/docs/hand_tracking_mobile_gpu.md
  44. BIN mediapipe/docs/images/mobile/multi_hand_detection_gpu_subgraph.png
  45. BIN mediapipe/docs/images/mobile/multi_hand_landmark_subgraph.png
  46. BIN mediapipe/docs/images/mobile/multi_hand_renderer_gpu_subgraph.png
  47. BIN mediapipe/docs/images/mobile/multi_hand_tracking_3d_android_gpu.gif
  48. BIN mediapipe/docs/images/mobile/multi_hand_tracking_android_gpu.gif
  49. BIN mediapipe/docs/images/mobile/multi_hand_tracking_mobile.png
  50. BIN mediapipe/docs/images/multi_hand_tracking_desktop.png
  51. +22 −22 mediapipe/docs/install.md
  52. +177 −0 mediapipe/docs/multi_hand_tracking_desktop.md
  53. +755 −0 mediapipe/docs/multi_hand_tracking_mobile_gpu.md
  54. +2 −4 mediapipe/docs/object_detection_desktop.md
  55. +33 −0 ...pipe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/AndroidManifest.xml
  56. +103 −0 mediapipe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/BUILD
  57. +167 −0 mediapipe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/MainActivity.java
  58. +20 −0 ...ples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/res/layout/activity_main.xml
  59. +6 −0 ...pe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/res/values/colors.xml
  60. +4 −0 ...e/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/res/values/strings.xml
  61. +11 −0 ...pe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu/res/values/styles.xml
  62. +28 −21 mediapipe/examples/desktop/media_sequence/kinetics_dataset.py
  63. +42 −0 mediapipe/examples/desktop/multi_hand_tracking/BUILD
  64. +1 −40 mediapipe/examples/desktop/object_detection/BUILD
  65. +21 −0 mediapipe/examples/ios/multihandtrackinggpu/AppDelegate.h
  66. +59 −0 mediapipe/examples/ios/multihandtrackinggpu/AppDelegate.m
  67. +99 −0 mediapipe/examples/ios/multihandtrackinggpu/Assets.xcassets/AppIcon.appiconset/Contents.json
  68. +7 −0 mediapipe/examples/ios/multihandtrackinggpu/Assets.xcassets/Contents.json
  69. +95 −0 mediapipe/examples/ios/multihandtrackinggpu/BUILD
  70. +25 −0 mediapipe/examples/ios/multihandtrackinggpu/Base.lproj/LaunchScreen.storyboard
  71. +51 −0 mediapipe/examples/ios/multihandtrackinggpu/Base.lproj/Main.storyboard
  72. +42 −0 mediapipe/examples/ios/multihandtrackinggpu/Info.plist
  73. +19 −0 mediapipe/examples/ios/multihandtrackinggpu/ViewController.h
  74. +178 −0 mediapipe/examples/ios/multihandtrackinggpu/ViewController.mm
  75. +22 −0 mediapipe/examples/ios/multihandtrackinggpu/main.m
  76. +5 −3 mediapipe/framework/BUILD
  77. +5 −4 mediapipe/framework/calculator_graph.cc
  78. +6 −6 mediapipe/framework/calculator_graph.h
  79. +1 −0 mediapipe/framework/calculator_graph_side_packet_test.cc
  80. +107 −3 mediapipe/framework/graph_validation_test.cc
  81. +1 −1 mediapipe/framework/packet.h
  82. +20 −0 mediapipe/framework/port/BUILD
  83. +26 −0 mediapipe/framework/port/opencv_calib3d_inc.h
  84. +26 −0 mediapipe/framework/port/opencv_features2d_inc.h
  85. +1 −1 mediapipe/framework/stream_handler/fixed_size_input_stream_handler.cc
  86. +2 −2 mediapipe/framework/testdata/BUILD
  87. +1 −1 mediapipe/framework/tool/BUILD
  88. +1 −1 mediapipe/framework/tool/mediapipe_graph.bzl
  89. +39 −0 mediapipe/framework/tool/subgraph_expansion.cc
  90. +3 −4 mediapipe/framework/validated_graph_config.cc
  91. +3 −3 mediapipe/framework/validated_graph_config.h
  92. +1 −1 mediapipe/graphs/face_detection/face_detection_desktop_live.pbtxt
  93. +46 −6 mediapipe/graphs/hand_tracking/BUILD
  94. +1 −1 mediapipe/graphs/hand_tracking/hand_detection_desktop_live.pbtxt
  95. +2 −2 mediapipe/graphs/hand_tracking/hand_detection_mobile.pbtxt
  96. +1 −1 mediapipe/graphs/hand_tracking/hand_tracking_desktop.pbtxt
  97. +2 −2 mediapipe/graphs/hand_tracking/hand_tracking_mobile.pbtxt
  98. +127 −0 mediapipe/graphs/hand_tracking/multi_hand_tracking_desktop.pbtxt
  99. +103 −0 mediapipe/graphs/hand_tracking/multi_hand_tracking_desktop_live.pbtxt
  100. +123 −0 mediapipe/graphs/hand_tracking/multi_hand_tracking_mobile.pbtxt
  101. +102 −4 mediapipe/graphs/hand_tracking/subgraphs/BUILD
  102. +213 −0 mediapipe/graphs/hand_tracking/subgraphs/multi_hand_detection_cpu.pbtxt
  103. +218 −0 mediapipe/graphs/hand_tracking/subgraphs/multi_hand_detection_gpu.pbtxt
  104. +84 −0 mediapipe/graphs/hand_tracking/subgraphs/multi_hand_landmark.pbtxt
  105. +144 −0 mediapipe/graphs/hand_tracking/subgraphs/multi_hand_renderer_cpu.pbtxt
  106. +144 −0 mediapipe/graphs/hand_tracking/subgraphs/multi_hand_renderer_gpu.pbtxt
  107. +1 −1 mediapipe/graphs/object_detection/object_detection_desktop_live.pbtxt
  108. +1 −1 mediapipe/graphs/object_detection/object_detection_desktop_tflite_graph.pbtxt
  109. +2 −2 mediapipe/graphs/object_detection/object_detection_mobile_cpu.pbtxt
  110. +2 −2 mediapipe/graphs/object_detection/object_detection_mobile_gpu.pbtxt
  111. +4 −4 mediapipe/util/sequence/BUILD
  112. +2 −0 third_party/opencv_linux.BUILD
  113. +2 −0 third_party/opencv_macos.BUILD
  114. +0 −25 third_party/rules_apple_c0863d0596ae6b769a29fa3fb72ff036444fd249.diff
  115. +0 −22 third_party/tensorflow_065c20bf79253257c87bd4614bb9a7fdef015cbb.diff
  116. +0 −24 third_party/tensorflow_f67fcbefce906cd419e4657f0d41e21019b71abd.diff
@@ -3,7 +3,7 @@
# Basic build settings
build --jobs 128
build --define='absl=1'
build --cxxopt='-std=c++11'
build --cxxopt='-std=c++14'
build --copt='-Wno-sign-compare'
build --copt='-Wno-unused-function'
build --copt='-Wno-uninitialized'
@@ -41,7 +41,10 @@ A web-based visualizer is hosted on [viz.mediapipe.dev](https://viz.mediapipe.de
* [MediaPipe: A Framework for Building Perception Pipelines](https://arxiv.org/abs/1906.08172)

## Events
* [ML Conference, Berlin 9-11 Dec 2019](https://mlconference.ai/machine-learning-advanced-development/mediapipe-building-real-time-cross-platform-mobile-web-edge-desktop-video-audio-ml-pipelines/)
* [MediaPipe Madrid Meetup, 16 Dec 2019](https://www.meetup.com/Madrid-AI-Developers-Group/events/266329088/)
* [MediaPipe London Meetup, Google 123 Building, 12 Dec 2019](https://www.meetup.com/London-AI-Tech-Talk/events/266329038)
* [ML Conference, Berlin, 11 Dec 2019](https://mlconference.ai/machine-learning-advanced-development/mediapipe-building-real-time-cross-platform-mobile-web-edge-desktop-video-audio-ml-pipelines/)
* [MediaPipe Berlin Meetup, Google Berlin, 11 Dec 2019](https://www.meetup.com/Berlin-AI-Tech-Talk/events/266328794/)
* [The 3rd Workshop on YouTube-8M Large Scale Video Understanding Workshop](https://research.google.com/youtube8m/workshop2019/index.html) Seoul, Korea ICCV 2019
* [AI DevWorld 2019](https://aidevworld.com) on Oct 10 in San Jose, California
* [Google Industry Workshop at ICIP 2019](http://2019.ieeeicip.org/?action=page4&id=14#Google) [Presentation](https://docs.google.com/presentation/d/e/2PACX-1vRIBBbO_LO9v2YmvbHHEt1cwyqH6EjDxiILjuT0foXy1E7g6uyh4CesB2DkkEwlRDO9_lWfuKMZx98T/pub?start=false&loop=false&delayms=3000&slide=id.g556cc1a659_0_5) on Sept 24 in Taipei, Taiwan
@@ -10,8 +10,7 @@ http_archive(
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
)
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "0.24.1",
maximum_bazel_version = "0.29.1")
versions.check(minimum_bazel_version = "0.24.1")

# ABSL cpp library.
http_archive(
@@ -104,9 +103,9 @@ http_archive(
],
)

# 2019-08-15
_TENSORFLOW_GIT_COMMIT = "67def62936e28f97c16182dfcc467d8d1cae02b4"
_TENSORFLOW_SHA256= "ddd4e3c056e7c0ff2ef29133b30fa62781dfbf8a903e99efb91a02d292fa9562"
# 2019-11-12
_TENSORFLOW_GIT_COMMIT = "a5f9bcd64453ff3d1f64cb4da4786db3d2da7f82"
_TENSORFLOW_SHA256= "f2b6f2ab2ffe63e86eccd3ce4bea6b7197383d726638dfeeebcdc1e7de73f075"
http_archive(
name = "org_tensorflow",
urls = [
@@ -115,13 +114,6 @@ http_archive(
],
strip_prefix = "tensorflow-%s" % _TENSORFLOW_GIT_COMMIT,
sha256 = _TENSORFLOW_SHA256,
patches = [
"@//third_party:tensorflow_065c20bf79253257c87bd4614bb9a7fdef015cbb.diff",
"@//third_party:tensorflow_f67fcbefce906cd419e4657f0d41e21019b71abd.diff",
],
patch_args = [
"-p1",
],
)

load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
@@ -255,18 +247,11 @@ android_sdk_repository(

# iOS basic build deps.

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
http_archive(
name = "build_bazel_rules_apple",
remote = "https://github.com/bazelbuild/rules_apple.git",
tag = "0.18.0",
patches = [
"@//third_party:rules_apple_c0863d0596ae6b769a29fa3fb72ff036444fd249.diff",
],
patch_args = [
"-p1",
],
sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
url = "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
)

load(
@@ -13,12 +13,12 @@
# limitations under the License.
#

load("//mediapipe/framework/port:build_config.bzl", "mediapipe_cc_proto_library")

licenses(["notice"]) # Apache 2.0

package(default_visibility = ["//visibility:private"])

load("//mediapipe/framework/port:build_config.bzl", "mediapipe_cc_proto_library")

proto_library(
name = "concatenate_vector_calculator_proto",
srcs = ["concatenate_vector_calculator.proto"],
@@ -79,6 +79,13 @@ proto_library(
],
)

proto_library(
name = "clip_vector_size_calculator_proto",
srcs = ["clip_vector_size_calculator.proto"],
visibility = ["//visibility:public"],
deps = ["//mediapipe/framework:calculator_proto"],
)

mediapipe_cc_proto_library(
name = "packet_cloner_calculator_cc_proto",
srcs = ["packet_cloner_calculator.proto"],
@@ -111,6 +118,14 @@ mediapipe_cc_proto_library(
deps = [":concatenate_vector_calculator_proto"],
)

mediapipe_cc_proto_library(
name = "clip_vector_size_calculator_cc_proto",
srcs = ["clip_vector_size_calculator.proto"],
cc_deps = ["//mediapipe/framework:calculator_cc_proto"],
visibility = ["//visibility:public"],
deps = [":clip_vector_size_calculator_proto"],
)

mediapipe_cc_proto_library(
name = "dequantize_byte_array_calculator_cc_proto",
srcs = ["dequantize_byte_array_calculator.proto"],
@@ -169,6 +184,66 @@ cc_test(
],
)

cc_library(
name = "begin_loop_calculator",
srcs = ["begin_loop_calculator.cc"],
hdrs = ["begin_loop_calculator.h"],
visibility = ["//visibility:public"],
deps = [
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework:collection_item_id",
"//mediapipe/framework:packet",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/memory",
],
alwayslink = 1,
)

cc_library(
name = "end_loop_calculator",
srcs = ["end_loop_calculator.cc"],
hdrs = ["end_loop_calculator.h"],
visibility = ["//visibility:public"],
deps = [
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework:collection_item_id",
"//mediapipe/framework:packet",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
"//mediapipe/util:render_data_cc_proto",
],
alwayslink = 1,
)

cc_test(
name = "begin_end_loop_calculator_graph_test",
srcs = ["begin_end_loop_calculator_graph_test.cc"],
deps = [
":begin_loop_calculator",
":end_loop_calculator",
"//mediapipe/calculators/core:packet_cloner_calculator",
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/memory",
],
)

cc_library(
name = "concatenate_vector_calculator",
srcs = ["concatenate_vector_calculator.cc"],
@@ -219,6 +294,50 @@ cc_test(
],
)

cc_library(
name = "clip_vector_size_calculator",
srcs = ["clip_vector_size_calculator.cc"],
hdrs = ["clip_vector_size_calculator.h"],
visibility = ["//visibility:public"],
deps = [
":clip_vector_size_calculator_cc_proto",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
"@org_tensorflow//tensorflow/lite:framework",
],
alwayslink = 1,
)

cc_library(
name = "clip_detection_vector_size_calculator",
srcs = ["clip_detection_vector_size_calculator.cc"],
visibility = ["//visibility:public"],
deps = [
":clip_vector_size_calculator",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/formats:detection_cc_proto",
],
alwayslink = 1,
)

cc_test(
name = "clip_vector_size_calculator_test",
srcs = ["clip_vector_size_calculator_test.cc"],
deps = [
":clip_vector_size_calculator",
"//mediapipe/calculators/core:packet_resampler_calculator_cc_proto",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework:calculator_runner",
"//mediapipe/framework:timestamp",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:parse_text_proto",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/strings",
],
)

cc_library(
name = "counting_source_calculator",
srcs = ["counting_source_calculator.cc"],
@@ -300,7 +419,7 @@ cc_library(
"//visibility:public",
],
deps = [
"//mediapipe/calculators/core:packet_cloner_calculator_cc_proto",
":packet_cloner_calculator_cc_proto",
"//mediapipe/framework:calculator_framework",
"@com_google_absl//absl/strings",
],

0 comments on commit 9437483

Please sign in to comment.
You can’t perform that action at this time.