Compare commits

..
757 Commits
Author SHA1 Message Date
Sebastian Schmidt 17f2d0e1e5 Add Face Landmarks Connection constants for the Python API 2023-04-13 14:19:10 -06:00
Sebastian SchmidtandGitHub f712eed6c3 Merge pull request #4286 from google/revert-4279-face-landmarker-python-add-connection-constants
Revert "Add Face Landmarks Connection constants for the Python API"
2023-04-13 14:14:02 -06:00
yichunkuoandGitHub 7cbf0033b0 Revert "Add Face Landmarks Connection constants for the Python API" 2023-04-14 04:12:33 +08:00
MediaPipe TeamandCopybara-Service a59b29ea24 Add jni functions to get image size from a list of image
PiperOrigin-RevId: 524080111
2023-04-13 13:05:42 -07:00
MediaPipe TeamandCopybara-Service ad169b9123 Add support for more standard scaling options in GlSurfaceViewRenderer.
PiperOrigin-RevId: 524062033
2023-04-13 11:52:45 -07:00
MediaPipe TeamandCopybara-Service c63b30dff5 Internal change
PiperOrigin-RevId: 524059494
2023-04-13 11:45:04 -07:00
MediaPipe TeamandCopybara-Service 055accece8 Internal Change
PiperOrigin-RevId: 524035898
2023-04-13 11:43:20 -07:00
yichunkuoandGitHub 78499b0bd0 Merge pull request #4279 from kinaryml/face-landmarker-python-add-connection-constants
Add Face Landmarks Connection constants for the Python API
2023-04-14 02:35:22 +08:00
Fergus HendersonandCopybara-Service c392ed2c09 Internal change
PiperOrigin-RevId: 524012087
2023-04-13 08:49:36 -07:00
MediaPipe TeamandCopybara-Service d095829c7c Internal cleanup.
PiperOrigin-RevId: 524005450
2023-04-13 08:19:29 -07:00
MediaPipe TeamandCopybara-Service 6af4b433f4 Internal change
PiperOrigin-RevId: 523965337
2023-04-13 04:36:16 -07:00
MediaPipe TeamandCopybara-Service 3fdd7f3618 Internal change
PiperOrigin-RevId: 523930101
2023-04-13 01:28:41 -07:00
kinaryml 4d5f081232 Reformatted face_landmarker.py 2023-04-13 01:18:37 -07:00
Kinar RandGitHub dc56eb2bb1 Update face_landmarker.py 2023-04-13 13:40:49 +05:30
Kinar RandGitHub 5185489c21 Update face_landmarker.py 2023-04-13 13:30:00 +05:30
MediaPipe TeamandCopybara-Service c8b9cec7ef Internal change
PiperOrigin-RevId: 523916108
2023-04-13 00:16:17 -07:00
MediaPipe TeamandCopybara-Service d96b6e7ed9 Make confidence and category masks both optional for GPU multi-class segmentation.
PiperOrigin-RevId: 523838907
2023-04-12 16:41:14 -07:00
Sebastian SchmidtandCopybara-Service f23dd69db1 Fix yet another Windows compile error
PiperOrigin-RevId: 523835509
2023-04-12 16:26:27 -07:00
Sebastian SchmidtandCopybara-Service d0e8a9e09b Internal change
PiperOrigin-RevId: 523827005
2023-04-12 15:49:58 -07:00
MediaPipe TeamandCopybara-Service 0179f0c456 Update TensorsToFaceLandmarksGraph to support face mesh v2 model.
PiperOrigin-RevId: 523814749
2023-04-12 15:03:26 -07:00
Sebastian SchmidtandCopybara-Service 468d10e947 Update WASM files for Alpha 10
PiperOrigin-RevId: 523810757
2023-04-12 14:47:22 -07:00
Copybara-Service dd62b0831a Merge pull request #4254 from priankakariatyml:ios-gesture-recognizer
PiperOrigin-RevId: 523808915
2023-04-12 14:40:31 -07:00
MediaPipe TeamandCopybara-Service a71c697d90 Internal change
PiperOrigin-RevId: 523797476
2023-04-12 13:58:11 -07:00
MediaPipe TeamandCopybara-Service 27c38f00ec Add pose landmarker C++ API.
PiperOrigin-RevId: 523795237
2023-04-12 13:51:54 -07:00
MediaPipe TeamandCopybara-Service c7aecb42ff Internal change
PiperOrigin-RevId: 523785788
2023-04-12 13:16:33 -07:00
kinaryml fec96ee679 Added some face landmarks constants 2023-04-12 13:03:46 -07:00
MediaPipe TeamandCopybara-Service 9a10375de6 internal change
PiperOrigin-RevId: 523773255
2023-04-12 12:27:59 -07:00
MediaPipe TeamandCopybara-Service ca0da8d26f Fix wrong function name of ConvertToDetection
PiperOrigin-RevId: 523760961
2023-04-12 11:42:48 -07:00
MediaPipe TeamandCopybara-Service 776dceb588 Build category mask without resizing tensors to image size.
PiperOrigin-RevId: 523754567
2023-04-12 11:22:30 -07:00
MediaPipe TeamandCopybara-Service 049ba8bbca Internal change
PiperOrigin-RevId: 523751152
2023-04-12 11:10:43 -07:00
Sebastian SchmidtandCopybara-Service f9a2d0995d Fix Windows compilation error
PiperOrigin-RevId: 523739720
2023-04-12 10:34:21 -07:00
MediaPipe TeamandCopybara-Service efab342a52 Internal change
PiperOrigin-RevId: 523733431
2023-04-12 10:16:15 -07:00
MediaPipe TeamandCopybara-Service 5bcdea2952 Internal MediaPipe Tasks change.
PiperOrigin-RevId: 523729183
2023-04-12 09:59:21 -07:00
MediaPipe TeamandCopybara-Service f41a912250 Internal change
PiperOrigin-RevId: 523703537
2023-04-12 08:14:13 -07:00
MediaPipe TeamandCopybara-Service 2eefc862c2 Internal change
PiperOrigin-RevId: 523632081
2023-04-12 01:25:23 -07:00
MediaPipe TeamandCopybara-Service a7c6910625 Internal change
PiperOrigin-RevId: 523616811
2023-04-11 23:52:14 -07:00
MediaPipe TeamandCopybara-Service 52e934a539 Internal change
PiperOrigin-RevId: 523611358
2023-04-11 23:13:45 -07:00
MediaPipe TeamandCopybara-Service f923f6bcda Internal change
PiperOrigin-RevId: 523589395
2023-04-11 21:03:38 -07:00
MediaPipe TeamandCopybara-Service c9aa24b0e7 Support proto3 node_option in api2 graph_builder
PiperOrigin-RevId: 523587324
2023-04-11 20:49:35 -07:00
MediaPipe TeamandCopybara-Service b6a19ea9e8 Add shaders that support better landscape rendering with GlSurfaceViewRenderer.
PiperOrigin-RevId: 523579769
2023-04-11 20:10:40 -07:00
Sebastian SchmidtandCopybara-Service 1b947df0c2 Allow relative URLs for WASM loading
PiperOrigin-RevId: 523572715
2023-04-11 19:25:03 -07:00
MediaPipe TeamandCopybara-Service e2b13523f1 F16 texture support in GPU multiclass TensorsToSegmentation
PiperOrigin-RevId: 523512145
2023-04-11 14:58:57 -07:00
Sebastian SchmidtandCopybara-Service 738aea7a06 Update WASM files for alpha 9
PiperOrigin-RevId: 523458140
2023-04-11 11:33:14 -07:00
Sebastian SchmidtandCopybara-Service 221d545080 Create Language Detection Web API
PiperOrigin-RevId: 523445524
2023-04-11 10:47:29 -07:00
Sebastian SchmidtandCopybara-Service b66b0e0c72 Internal change
PiperOrigin-RevId: 523429555
2023-04-11 09:56:46 -07:00
MediaPipe TeamandCopybara-Service a448790300 Internal change
PiperOrigin-RevId: 523351901
2023-04-11 03:23:24 -07:00
MediaPipe TeamandCopybara-Service 9793654364 Update Halide build rules for MediaPipe to use Halide v15.0.1
PiperOrigin-RevId: 523351862
2023-04-11 03:18:54 -07:00
MediaPipe TeamandCopybara-Service de7560c825 Internal change
PiperOrigin-RevId: 523339435
2023-04-11 02:11:41 -07:00
MediaPipe TeamandCopybara-Service b8ebbbea0b Internal change
PiperOrigin-RevId: 523324063
2023-04-11 00:46:49 -07:00
MediaPipe TeamandCopybara-Service a4172cb03f Internal change
PiperOrigin-RevId: 523306493
2023-04-10 22:50:58 -07:00
MediaPipe TeamandCopybara-Service 3bb411e99d Special treatment for 1-class segmentation category mask output on GPU.
PiperOrigin-RevId: 523271622
2023-04-10 19:13:38 -07:00
Sebastian SchmidtandCopybara-Service 87ec846ed6 Enable TextClassifier and TextEmbedder on Windows Python
PiperOrigin-RevId: 523233995
2023-04-10 15:57:19 -07:00
MediaPipe TeamandCopybara-Service c1f17138cf Upgrades and fixes for image segmentation category mask on GPU
PiperOrigin-RevId: 523204584
2023-04-10 13:58:20 -07:00
MediaPipe TeamandCopybara-Service 02fed0b7d1 Cover the existing graph expansion behavior in regard to executors with unit tests.
PiperOrigin-RevId: 523192292
2023-04-10 13:07:51 -07:00
Sebastian SchmidtandCopybara-Service e5f28bc136 Make AudioTools compile when build from python:framework_bindings
PiperOrigin-RevId: 523158401
2023-04-10 11:00:15 -07:00
Copybara-Service b685f53c6b Merge pull request #4263 from kinaryml:face-stylizer-python-tests
PiperOrigin-RevId: 523152290
2023-04-10 10:39:50 -07:00
MediaPipe TeamandCopybara-Service c036b9f408 Adds a LanguageDetector Java API.
PiperOrigin-RevId: 522895455
2023-04-08 22:31:28 -07:00
MediaPipe TeamandCopybara-Service 4f77504af6 Internal change
PiperOrigin-RevId: 522787446
2023-04-08 03:01:54 -07:00
kinaryml 18d5beb598 Updated FaceStylizer API to align with the new Base Vision Task API changes 2023-04-08 01:38:48 -07:00
MediaPipe TeamandCopybara-Service 7b067a1fda Add face landmarks connection for java API.
PiperOrigin-RevId: 522728488
2023-04-07 18:27:39 -07:00
Sebastian SchmidtandCopybara-Service e19b49ba13 Fix indent
PiperOrigin-RevId: 522715076
2023-04-07 16:59:03 -07:00
Sebastian SchmidtandCopybara-Service 2efcf30eea Add FaceLandmarksConnections to Web API
PiperOrigin-RevId: 522713874
2023-04-07 16:53:57 -07:00
Sebastian SchmidtandCopybara-Service 938b501d15 Don't use OffscreenCanvas on Safari
PiperOrigin-RevId: 522689566
2023-04-07 14:51:18 -07:00
Jiuqiang TangandCopybara-Service 8cedb82df1 Expose face stylizer and interactive segmenter to be public mediapipe python API.
PiperOrigin-RevId: 522654239
2023-04-07 12:12:49 -07:00
MediaPipe TeamandCopybara-Service a1ce19f68e Internal change
PiperOrigin-RevId: 522631851
2023-04-07 10:47:36 -07:00
MediaPipe TeamandCopybara-Service e3185e3df0 Internal change
PiperOrigin-RevId: 522614549
2023-04-07 09:30:36 -07:00
Jiuqiang TangandCopybara-Service bca0a92c2e Add FaceToRectCalculator.
PiperOrigin-RevId: 522595752
2023-04-07 07:44:51 -07:00
MediaPipe TeamandCopybara-Service b0d3595291 Internal change
PiperOrigin-RevId: 522541374
2023-04-07 00:30:49 -07:00
MediaPipe TeamandCopybara-Service c6b3090d0e Internal change
PiperOrigin-RevId: 522534050
2023-04-06 23:31:15 -07:00
MediaPipe TeamandCopybara-Service 6c523cd21f Internal change
PiperOrigin-RevId: 522529789
2023-04-06 22:56:06 -07:00
MediaPipe TeamandCopybara-Service bae14a83b2 Internal change
PiperOrigin-RevId: 522524565
2023-04-06 22:13:38 -07:00
MediaPipe TeamandCopybara-Service 4e5f20f212 Internal change
PiperOrigin-RevId: 522494903
2023-04-06 19:02:16 -07:00
Copybara-Service 6495f8624b Merge pull request #4241 from kinaryml:interactive-segmenter-python
PiperOrigin-RevId: 522470912
2023-04-06 16:47:46 -07:00
MediaPipe TeamandCopybara-Service 38f838513a Enable defining and using internal executor within a subgraph
PiperOrigin-RevId: 522449982
2023-04-06 15:18:56 -07:00
Prianka Liz Kariat fe5ca09030 Added MPPGestureRecognizerOptions.m 2023-04-07 01:01:39 +05:30
Prianka Liz Kariat 49c614280f Added MPPGestureRecognizerOptions 2023-04-07 00:58:53 +05:30
Prianka Liz Kariat 6f5b12d056 Added MPPGestureRecognizerResult 2023-04-07 00:58:26 +05:30
Prianka Liz Kariat 1992dfdf2c Added MPPClassifierOptions 2023-04-07 00:57:52 +05:30
Prianka Liz Kariat 9ce300c711 Added MPPClassifierOptions 2023-04-07 00:57:33 +05:30
Prianka Liz Kariat 5272980c2e Added MPPLandmarkHelpers 2023-04-07 00:57:19 +05:30
Prianka Liz Kariat cfa261b34f Added MPPLandmark 2023-04-07 00:57:01 +05:30
Copybara-Service 81a405af1b Merge pull request #4253 from priankakariatyml:object-detector-sources
PiperOrigin-RevId: 522401491
2023-04-06 12:15:34 -07:00
MediaPipe TeamandCopybara-Service 489d684699 Internal change
PiperOrigin-RevId: 522398388
2023-04-06 12:04:03 -07:00
Sebastian SchmidtandCopybara-Service 3588be3342 Update WASM files for Alpha 8
PiperOrigin-RevId: 522376911
2023-04-06 10:49:32 -07:00
Copybara-Service 37334098b0 Merge pull request #4248 from Neilblaze:docs-fix_breaks
PiperOrigin-RevId: 522355500
2023-04-06 09:29:52 -07:00
Prianka Liz Kariat 30341024de Added MPPObjectDetector 2023-04-06 21:40:52 +05:30
Prianka Liz Kariat b01b3b84c4 Added MPPObjectDetectionResultHelpers 2023-04-06 21:40:09 +05:30
Prianka Liz Kariat 79c8cfb730 Added MPPObjectDetectorOptionsHelpers 2023-04-06 21:39:56 +05:30
MediaPipe TeamandCopybara-Service 7d8d3ab196 Add EDGETPU_NNAPI delegate option in MediaPipe tasks API
PiperOrigin-RevId: 522344828
2023-04-06 08:42:15 -07:00
MediaPipe TeamandCopybara-Service 97bd9c2157 Internal change
PiperOrigin-RevId: 522307800
2023-04-06 05:01:29 -07:00
MediaPipe TeamandCopybara-Service 2e256bebb5 Internal change
PiperOrigin-RevId: 522292310
2023-04-06 03:20:04 -07:00
MediaPipe TeamandCopybara-Service e894ae9cf4 Internal change
PiperOrigin-RevId: 522291640
2023-04-06 03:15:24 -07:00
MediaPipe TeamandCopybara-Service 289f51651f Make GraphTextureFrame constructor public.
PiperOrigin-RevId: 522287217
2023-04-06 02:54:16 -07:00
MediaPipe TeamandCopybara-Service a151e6485a Internal change
PiperOrigin-RevId: 522287183
2023-04-06 02:50:05 -07:00
MediaPipe TeamandCopybara-Service 3c083f5d2b Internal change
PiperOrigin-RevId: 522282159
2023-04-06 02:18:58 -07:00
MediaPipe TeamandCopybara-Service 8d8ab9a972 Internal change
PiperOrigin-RevId: 522275233
2023-04-06 01:35:59 -07:00
MediaPipe TeamandCopybara-Service 22186299c4 Internal change
PiperOrigin-RevId: 522263621
2023-04-06 00:21:14 -07:00
MediaPipe TeamandCopybara-Service d05508cb7b Internal change
PiperOrigin-RevId: 522260226
2023-04-06 00:00:50 -07:00
MediaPipe TeamandCopybara-Service 56552dbfb5 Internal change
PiperOrigin-RevId: 522255364
2023-04-05 23:28:50 -07:00
MediaPipe TeamandCopybara-Service 12ecc8139f Internal change
PiperOrigin-RevId: 522255287
2023-04-05 23:24:55 -07:00
MediaPipe TeamandCopybara-Service 56b3cd4350 Internal change
PiperOrigin-RevId: 522253757
2023-04-05 23:14:45 -07:00
MediaPipe TeamandCopybara-Service 0067a1b5c2 Internal changes
PiperOrigin-RevId: 522248624
2023-04-05 22:37:11 -07:00
MediaPipe TeamandCopybara-Service 5a1a9269e6 Internal Changes
PiperOrigin-RevId: 522247775
2023-04-05 22:31:13 -07:00
Copybara-Service 7455022980 Merge pull request #4165 from kinaryml:audio-record-api-python
PiperOrigin-RevId: 522240683
2023-04-05 21:46:20 -07:00
MediaPipe TeamandCopybara-Service 7ae4d0175a CL will fix the typos in the tasks files
PiperOrigin-RevId: 522240681
2023-04-05 21:42:19 -07:00
MediaPipe TeamandCopybara-Service d5def9e24d Image segmenter output both confidence masks and category mask optionally.
PiperOrigin-RevId: 522227345
2023-04-05 20:34:18 -07:00
Hadon NashandCopybara-Service 7fe87936e5 Internal change
PiperOrigin-RevId: 522206591
2023-04-05 18:15:29 -07:00
neilblaze 07c0756b5d fixed errors in docs
Signed-off-by: Pratyay Banerjee <[email protected]>
2023-04-06 05:19:13 +05:30
Sebastian SchmidtandCopybara-Service f67007d077 Remove platform information for x86
PiperOrigin-RevId: 522182423
2023-04-05 16:21:24 -07:00
MediaPipe TeamandCopybara-Service 065d750781 Add VEC32F4 support to ImageFrame
PiperOrigin-RevId: 522153305
2023-04-05 14:25:17 -07:00
MediaPipe TeamandCopybara-Service 6605f551e7 Object Detector add batch_size and train_data to get_steps_per_epoch.
PiperOrigin-RevId: 522149938
2023-04-05 14:11:29 -07:00
MediaPipe TeamandCopybara-Service 5615c1e459 Delete duplicate public APIs in object detector
PiperOrigin-RevId: 522098326
2023-04-05 10:58:08 -07:00
MediaPipe TeamandCopybara-Service c5bd34ddb0 Internal change
PiperOrigin-RevId: 522014435
2023-04-05 04:25:25 -07:00
MediaPipe TeamandCopybara-Service 425a3ee3f6 Internal change
PiperOrigin-RevId: 521993439
2023-04-05 02:26:02 -07:00
MediaPipe TeamandCopybara-Service 91264eab1f Internal change
PiperOrigin-RevId: 521982139
2023-04-05 01:20:21 -07:00
MediaPipe TeamandCopybara-Service 05801b9945 Internal change
PiperOrigin-RevId: 521981387
2023-04-05 01:16:13 -07:00
MediaPipe TeamandCopybara-Service 46f9270788 Internal change
PiperOrigin-RevId: 521980958
2023-04-05 01:10:15 -07:00
MediaPipe TeamandCopybara-Service 7417e48da4 Internal change
PiperOrigin-RevId: 521970274
2023-04-05 00:05:39 -07:00
Kinar RandGitHub 1068755d2c Merge branch 'master' into interactive-segmenter-python 2023-04-05 10:51:45 +05:30
MediaPipe TeamandCopybara-Service 1990fe00d3 Internal change
PiperOrigin-RevId: 521949598
2023-04-04 21:35:10 -07:00
MediaPipe TeamandCopybara-Service 7cb8c647ca Internal change
PiperOrigin-RevId: 521948037
2023-04-04 21:24:55 -07:00
MediaPipe TeamandCopybara-Service 190be2e1bd Internal change
PiperOrigin-RevId: 521911790
2023-04-04 17:44:29 -07:00
MediaPipe TeamandCopybara-Service f8b2aa0633 Internal change
PiperOrigin-RevId: 521909998
2023-04-04 17:35:57 -07:00
MediaPipe TeamandCopybara-Service 9554836145 Update java image segmenter to always output confidence masks and optionally output category mask.
PiperOrigin-RevId: 521852718
2023-04-04 13:39:33 -07:00
MediaPipe TeamandCopybara-Service 55bcfcb4f5 Internal change
PiperOrigin-RevId: 521834742
2023-04-04 12:30:54 -07:00
Sebastian SchmidtandCopybara-Service a98f6bf231 FaceDetector Web API
PiperOrigin-RevId: 521816795
2023-04-04 11:23:00 -07:00
MediaPipe TeamandCopybara-Service 33cad24a5a Update java image segmenter to always output confidence masks and optionally output category mask.
PiperOrigin-RevId: 521804641
2023-04-04 10:41:59 -07:00
Copybara-Service 7c2930102d Merge pull request #4192 from kinaryml:face-stylizer-python
PiperOrigin-RevId: 521781683
2023-04-04 09:18:19 -07:00
MediaPipe TeamandCopybara-Service 65a98be809 Fixed comment and added note.
PiperOrigin-RevId: 521772542
2023-04-04 08:40:04 -07:00
MediaPipe TeamandCopybara-Service ec1d84aff7 Internal change
PiperOrigin-RevId: 521718577
2023-04-04 03:59:47 -07:00
MediaPipe TeamandCopybara-Service e95f465d58 Internal change
PiperOrigin-RevId: 521716263
2023-04-04 03:44:56 -07:00
MediaPipe TeamandCopybara-Service 53fa35e40c Add FrameBuffer view on ImageFrame.
PiperOrigin-RevId: 521689386
2023-04-04 01:19:07 -07:00
MediaPipe TeamandCopybara-Service 367ccbfdf3 update ImageSegmenterGraph to always output confidence mask and optionally output category mask
PiperOrigin-RevId: 521679910
2023-04-04 00:25:22 -07:00
Joe FernandezandCopybara-Service c31a4681e5 Fix left navigation mediapipe.dev docs legacy solutions web pages
PiperOrigin-RevId: 521609493
2023-04-03 17:44:07 -07:00
MediaPipe TeamandCopybara-Service 7c7eb74ef2 Internal change
PiperOrigin-RevId: 521586389
2023-04-03 16:00:24 -07:00
jqtang 3c05df9c46 Merge pull request #4235 from priankakariatyml:ios-object-detection-containers
PiperOrigin-RevId: 521553151
2023-04-03 15:12:06 -07:00
Sebastian SchmidtandCopybara-Service e84799ee37 Internal change
PiperOrigin-RevId: 521483663
2023-04-03 09:45:42 -07:00
Prianka Liz Kariat 048cc51e13 Added new line 2023-04-03 20:15:35 +05:30
Prianka Liz Kariat 1ab9b138ef Added MPPObjectDetectorOptions 2023-04-03 20:14:41 +05:30
Prianka Liz Kariat 67fcf9196e Added MPPObjectDetectionResult 2023-04-03 20:14:26 +05:30
Prianka Liz Kariat 4943029d62 Added MPPDetectionHelpers 2023-04-03 20:11:44 +05:30
Prianka Liz Kariat 9421249de1 Added MPPDetection 2023-04-03 20:07:45 +05:30
MediaPipe TeamandCopybara-Service cfe91f3c8c Internal change
PiperOrigin-RevId: 521424672
2023-04-03 04:46:59 -07:00
MediaPipe TeamandCopybara-Service 4a490cd27c This CL fixes the multiple typos in the new task api solution
PiperOrigin-RevId: 521407588
2023-04-03 03:05:29 -07:00
MediaPipe TeamandCopybara-Service b5bbed8ebb Internal change
PiperOrigin-RevId: 521406957
2023-04-03 03:01:23 -07:00
MediaPipe TeamandCopybara-Service 696bedcaa1 Internal change
PiperOrigin-RevId: 521327449
2023-04-02 17:43:47 -07:00
MediaPipe TeamandCopybara-Service 1fa9b2c985 Internal change
PiperOrigin-RevId: 521279971
2023-04-02 08:32:09 -07:00
MediaPipe TeamandCopybara-Service 50a49fd16c Internal change
PiperOrigin-RevId: 521226781
2023-04-01 22:29:07 -07:00
MediaPipe TeamandCopybara-Service d9f940f8b2 Model Maker object detector change learning_rate_boundaries to learning_rate_epoch_boundaries.
PiperOrigin-RevId: 521024056
2023-03-31 15:19:26 -07:00
Jiuqiang TangandCopybara-Service 7f9fd4f154 Add the minimum version number requirement to sounddevice in requirements.txt.
PiperOrigin-RevId: 520998845
2023-03-31 13:27:42 -07:00
Sebastian SchmidtandCopybara-Service c40e0fb6d5 Internal change
PiperOrigin-RevId: 520956127
2023-03-31 10:33:27 -07:00
MediaPipe TeamandCopybara-Service 1ff80f906c draw mouth to shoulder line after connection, to align with python viz code
PiperOrigin-RevId: 520935390
2023-03-31 09:05:10 -07:00
MediaPipe TeamandCopybara-Service 4dcb9a2201 Internal change
PiperOrigin-RevId: 520875109
2023-03-31 03:06:43 -07:00
MediaPipe TeamandCopybara-Service 733216da7e Use "x86_32" instead of "i386" for Bazel CPU ID -- they are currently synonyms, but "i386" is likely to be deprecated and removed in the future.
PiperOrigin-RevId: 520865783
2023-03-31 02:06:53 -07:00
MediaPipe TeamandCopybara-Service 5fe4e1ad0e Internal change
PiperOrigin-RevId: 520861522
2023-03-31 01:39:07 -07:00
Alan KellyandCopybara-Service 6a6786673e Do not explicitly set XNNPACK delegate flags.
XNNPACK is now enabled by default for all types so the behaviour remains identical.

PiperOrigin-RevId: 520855384
2023-03-31 00:59:29 -07:00
MediaPipe TeamandCopybara-Service 88d68341de Migrate face stylizer model files to GCS to use downloadable models in model maker.
PiperOrigin-RevId: 520848629
2023-03-31 00:11:51 -07:00
MediaPipe TeamandCopybara-Service 4ce87866da Add landmarks smoothing filter when requested face num is 1.
PiperOrigin-RevId: 520825046
2023-03-30 21:30:24 -07:00
MediaPipe TeamandCopybara-Service ea9083c89d visualize blaze pose for controlnet
PiperOrigin-RevId: 520823020
2023-03-30 21:20:06 -07:00
Sebastian SchmidtandCopybara-Service 145fc1ed38 Don't overwrite detection options if not specified in setOptions()
PiperOrigin-RevId: 520790479
2023-03-30 17:56:05 -07:00
Jiuqiang TangandCopybara-Service 508c72ddc9 Internal changes
PiperOrigin-RevId: 520775988
2023-03-30 16:45:34 -07:00
MediaPipe TeamandCopybara-Service 1eeb89e95f Add the model configuration and training hyperparameters for BlazeFaceStylizer.
PiperOrigin-RevId: 520767282
2023-03-30 16:07:11 -07:00
MediaPipe TeamandCopybara-Service a4923ca7aa Internal compatible_with change
PiperOrigin-RevId: 520751319
2023-03-30 15:01:09 -07:00
MediaPipe TeamandCopybara-Service f8f7126bdd Internal change
PiperOrigin-RevId: 520726897
2023-03-30 13:27:19 -07:00
MediaPipe TeamandCopybara-Service d43579fe3e Internal change
PiperOrigin-RevId: 520717805
2023-03-30 12:56:44 -07:00
MediaPipe TeamandCopybara-Service 99ba7dd787 Rewrite audio buffer conversion in Eigen primitives
PiperOrigin-RevId: 520717550
2023-03-30 12:52:22 -07:00
Jiuqiang TangandCopybara-Service 984073bf73 Fix the "'<>' with anonymous inner classes is not supported" error.
PiperOrigin-RevId: 520705926
2023-03-30 12:05:08 -07:00
MediaPipe TeamandCopybara-Service d7fd5b0cf5 Fix incorrect rotation handling in C++ vision tasks
PiperOrigin-RevId: 520670536
2023-03-30 10:05:25 -07:00
MediaPipe TeamandCopybara-Service 0e951b8add Internal change
PiperOrigin-RevId: 520636929
2023-03-30 07:48:07 -07:00
MediaPipe TeamandCopybara-Service 15d81576aa Change getLabels method to public
PiperOrigin-RevId: 520537239
2023-03-29 22:12:52 -07:00
Sebastian SchmidtandCopybara-Service f9eb3defa0 Internal change
PiperOrigin-RevId: 520523622
2023-03-29 21:04:07 -07:00
Sebastian SchmidtandCopybara-Service ac52859f1d Gracefully fail resource path lookup for Python on Windows
PiperOrigin-RevId: 520513921
2023-03-29 20:14:29 -07:00
Sebastian SchmidtandCopybara-Service ee1807d8e3 Don't use Bazel runfiles on for Python on Windows
PiperOrigin-RevId: 520504539
2023-03-29 19:10:07 -07:00
Sebastian SchmidtandCopybara-Service eaa708a18d Enable TextClassifier and TextEmbedder on Windows Python
PiperOrigin-RevId: 520498308
2023-03-29 18:26:53 -07:00
Sebastian SchmidtandCopybara-Service df67b35348 Internal change
PiperOrigin-RevId: 520486540
2023-03-29 17:27:16 -07:00
Sebastian SchmidtandCopybara-Service 6be4aedcf7 Use mediapipe_proto_library for all MediaPipe Protos
PiperOrigin-RevId: 520451054
2023-03-29 15:00:59 -07:00
MediaPipe TeamandCopybara-Service 0c8f691a36 Internal changes
PiperOrigin-RevId: 520411557
2023-03-29 12:35:20 -07:00
MediaPipe TeamandCopybara-Service 8e9207a7de Internal change
PiperOrigin-RevId: 520373147
2023-03-29 10:24:10 -07:00
Sebastian SchmidtandCopybara-Service b3d999704f FaceStylizer Java API
PiperOrigin-RevId: 520344417
2023-03-29 08:37:50 -07:00
MediaPipe TeamandCopybara-Service 316bd05e86 Internal change
PiperOrigin-RevId: 520263349
2023-03-29 01:35:04 -07:00
Sebastian SchmidtandCopybara-Service dc132a5629 Don't use Bazel runfiles on for Python on Windows
PiperOrigin-RevId: 520174325
2023-03-28 17:04:16 -07:00
MediaPipe TeamandCopybara-Service 9ee02481b1 Fix object detector pascal voc dataloader issue
PiperOrigin-RevId: 520160549
2023-03-28 16:06:44 -07:00
Jiuqiang TangandCopybara-Service 1e77725a15 Add necessary java lite proto source code to mediapipe tasks aar for the face landmarker task.
PiperOrigin-RevId: 520143851
2023-03-28 15:01:50 -07:00
Sebastian SchmidtandCopybara-Service 62d86494b0 Allow users to pass canvas: undefined
PiperOrigin-RevId: 520142520
2023-03-28 14:56:19 -07:00
Jiuqiang TangandCopybara-Service bda2639376 Switch to use the isPresent() API since the isEmpty() is only available since java 11: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html#isEmpty().
PiperOrigin-RevId: 520099308
2023-03-28 12:20:55 -07:00
Sebastian SchmidtandCopybara-Service 5c295da6ff Return custom error if model download fails
PiperOrigin-RevId: 520066065
2023-03-28 10:30:03 -07:00
Jiuqiang TangandCopybara-Service d4ec485971 Add face landmarker and face geometry java lite proto source code into mediapipe tasks AAR.
PiperOrigin-RevId: 520049667
2023-03-28 09:29:45 -07:00
MediaPipe TeamandCopybara-Service b4e1f0236a Add EndLoopImageCalculator
PiperOrigin-RevId: 520033132
2023-03-28 08:20:56 -07:00
MediaPipe TeamandCopybara-Service 0ea7b220f4 Add a function to convert CoreAudio buffers into a MediaPipe time series matrix
PiperOrigin-RevId: 519968274
2023-03-28 02:36:36 -07:00
MediaPipe TeamandCopybara-Service a18a62ef04 Make AnnotationOverlayCalculator compatible with GLES2/WebGL1 by using GL_RGB as internal format instead of GL_RGB8 for the texture that OpenCV renders into.
PiperOrigin-RevId: 519933934
2023-03-27 23:13:16 -07:00
Jiuqiang TangandCopybara-Service 94db96fa5e Add MatrixDataProto.java to mediapipe aar.
PiperOrigin-RevId: 519925872
2023-03-27 22:22:17 -07:00
Sebastian SchmidtandCopybara-Service 105e7b7467 Add no-copy Image getter for JNIS
PiperOrigin-RevId: 519909198
2023-03-27 20:59:23 -07:00
Copybara-Service 59b3150fff Merge pull request #4194 from priankakariatyml:ios-image-classifier-tests
PiperOrigin-RevId: 519907148
2023-03-27 20:46:18 -07:00
MediaPipe TeamandCopybara-Service 004265bbbd remove the check that data streams need to be > 0 since we have a use case of:
input_stream: "ALLOW:"
output_stream: "STATE_CHANGE"
PiperOrigin-RevId: 519891414
2023-03-27 19:14:24 -07:00
MediaPipe TeamandCopybara-Service 5f8831660f Internal MediaPipe Tasks change.
PiperOrigin-RevId: 519878741
2023-03-27 17:55:28 -07:00
Liam Miller-CushonandCopybara-Service 2d553a57e8 Update path to Doclava
PiperOrigin-RevId: 519850747
2023-03-27 15:51:26 -07:00
Jiuqiang TangandCopybara-Service c3b4fa5627 Expose face detector and face landmarker as public MediaPipe Tasks Python API.
PiperOrigin-RevId: 519822084
2023-03-27 14:03:21 -07:00
Sebastian SchmidtandCopybara-Service 7dd5f9b6c6 Add face_landmarker to vision types
PiperOrigin-RevId: 519815735
2023-03-27 13:39:51 -07:00
MediaPipe TeamandCopybara-Service 1fdc82d7ec Internal change
PiperOrigin-RevId: 519805707
2023-03-27 13:02:37 -07:00
Sebastian SchmidtandCopybara-Service e2f2acca5e Update WASM files for alpha-6 release
PiperOrigin-RevId: 519738578
2023-03-27 09:09:08 -07:00
MediaPipe TeamandCopybara-Service 7fdec2ecdf FaceLandmarker Java API
PiperOrigin-RevId: 519704560
2023-03-27 06:35:03 -07:00
MediaPipe TeamandCopybara-Service 9f888435b7 Internal change
PiperOrigin-RevId: 519674123
2023-03-27 03:40:24 -07:00
MediaPipe TeamandCopybara-Service 5ccf986513 This CL fixes the multiple typos in the new task api solution
PiperOrigin-RevId: 519634122
2023-03-26 23:57:38 -07:00
kinaryml e364aeb359 Revised Interactive Segmenter API and added more tests 2023-03-25 00:44:30 -07:00
Jiuqiang TangandCopybara-Service 55b9bd9d5e Internal change
PiperOrigin-RevId: 519224694
2023-03-24 13:33:47 -07:00
MediaPipe TeamandCopybara-Service 97c271644a Open Source Object Detector
PiperOrigin-RevId: 519201221
2023-03-24 11:53:18 -07:00
Sebastian SchmidtandCopybara-Service 58a98bc7da Add FaceLandmarker Web API
PiperOrigin-RevId: 519198210
2023-03-24 11:41:24 -07:00
Jiuqiang TangandCopybara-Service d6256362ec Internal change
PiperOrigin-RevId: 519186057
2023-03-24 10:56:50 -07:00
Sebastian SchmidtandCopybara-Service 9f6b2cd577 Add convertFromClassifications() helper
PiperOrigin-RevId: 519181016
2023-03-24 10:39:17 -07:00
Sebastian SchmidtandCopybara-Service cec878df2b Add Matrix output type
PiperOrigin-RevId: 519158476
2023-03-24 09:11:03 -07:00
MediaPipe TeamandCopybara-Service 53e4e92505 Support single channel golden images.
PiperOrigin-RevId: 519158051
2023-03-24 09:06:41 -07:00
MediaPipe TeamandCopybara-Service c26965c842 Internal change
PiperOrigin-RevId: 519150182
2023-03-24 08:34:11 -07:00
MediaPipe TeamandCopybara-Service 712ea6f15b Internal change
PiperOrigin-RevId: 519013105
2023-03-23 18:08:55 -07:00
Hadon NashandCopybara-Service 8a55f11952 Internal change
PiperOrigin-RevId: 519010016
2023-03-23 17:51:26 -07:00
Sebastian SchmidtandCopybara-Service 6aab4e013d Typo Fix
PiperOrigin-RevId: 518994598
2023-03-23 16:35:23 -07:00
MediaPipe TeamandCopybara-Service 27a5a6d433 Internal Changes
PiperOrigin-RevId: 518976200
2023-03-23 15:20:50 -07:00
MediaPipe TeamandCopybara-Service 948e17f404 Internal change
PiperOrigin-RevId: 518906661
2023-03-23 10:57:43 -07:00
Sebastian SchmidtandCopybara-Service 7b20a8e056 Update the WASM files for alpha5 Web release
PiperOrigin-RevId: 518905561
2023-03-23 10:53:38 -07:00
Sebastian SchmidtandCopybara-Service 8e5eadbd4e Add WebGLTexture output for ImageSegmenter
PiperOrigin-RevId: 518886135
2023-03-23 09:47:35 -07:00
Sebastian SchmidtandCopybara-Service 1c9e6894f3 Allow users to pass canvas element
PiperOrigin-RevId: 518870611
2023-03-23 08:46:21 -07:00
Prianka Liz Kariat 58adb69c44 Removed unwanted iOS tests 2023-03-23 20:16:30 +05:30
Prianka Liz Kariat 8682a3ffd9 Updated formatted 2023-03-23 19:58:03 +05:30
Prianka Liz Kariat da8b60700b Added flow limiter calculator to iOS vision tasks 2023-03-23 19:53:35 +05:30
Prianka Liz Kariat f51736e32d Added flow limiting for live stream mode in MPPImageClassifier 2023-03-23 19:52:14 +05:30
Prianka Liz Kariat 59e0b1ba74 Added stream info for some modes in MPPImageClassifier 2023-03-23 19:51:25 +05:30
Prianka Liz Kariat aa760855ee Updated formatting 2023-03-23 19:48:50 +05:30
Prianka Liz Kariat 1685664bdb Fixed formatting 2023-03-23 19:45:53 +05:30
Prianka Liz Kariat 55483776ab Fixed Issue with Flow Limiter in MPPTaskInfo 2023-03-23 19:44:56 +05:30
Prianka Liz Kariat d4b60a781e Added MPPImageClassifier Objective C Tests 2023-03-23 18:44:01 +05:30
Prianka Liz Kariat 48190e6600 Updated method signatures in MPPImage+TestUtils 2023-03-23 18:43:30 +05:30
Prianka Liz Kariat 8077743bfc Linked in Opencv ios framework with vision tasks. 2023-03-23 18:42:57 +05:30
Prianka Liz Kariat 1904632282 Fixed incorrect method call for image mode 2023-03-23 18:42:12 +05:30
Prianka Liz Kariat 960e7a6283 Fixed incorrect method call in MPPImageClassifier for Image Mode 2023-03-23 18:41:50 +05:30
Prianka Liz Kariat 1c4be91a3a Fixed stream names in MPPImageClassifier 2023-03-23 18:41:27 +05:30
Prianka Liz Kariat ddce041725 Fixed incorrect stride value in MPPImageUtils 2023-03-23 18:40:53 +05:30
Prianka Liz Kariat 3227635ea0 Fixed bug in roi assignment 2023-03-23 18:40:15 +05:30
Prianka Liz Kariat 6e62c113fb Fixed iOS running mode display strings 2023-03-23 18:39:54 +05:30
MediaPipe TeamandCopybara-Service 5998e96eed Internal change
PiperOrigin-RevId: 518814155
2023-03-23 03:35:43 -07:00
MediaPipe TeamandCopybara-Service 58fa1e2ec3 Internal change
PiperOrigin-RevId: 518813508
2023-03-23 03:31:46 -07:00
kinaryml 6304756c93 Added Interactive Segmenter Python API and some tests 2023-03-23 02:00:18 -07:00
Prianka Liz Kariat 2e4e17d837 Added MPPImage Utils for tests 2023-03-23 13:13:03 +05:30
MediaPipe TeamandCopybara-Service eac6348fd3 Open-sources a LanguageDetector C++ API.
PiperOrigin-RevId: 518758730
2023-03-22 21:54:35 -07:00
kinaryml 29a4041353 Fixed a typo in docstring 2023-03-22 21:51:45 -07:00
kinaryml ca18b95510 Updated BUILD 2023-03-22 21:50:40 -07:00
kinaryml 8cba65c229 Updated BUILD 2023-03-22 21:50:07 -07:00
kinaryml 613bcf99f4 Removed model 2023-03-22 21:49:11 -07:00
kinaryml c0320b556c Removed unit tests 2023-03-22 21:47:38 -07:00
kinaryml da70497f35 Updated Face Stylizer implementation and tests 2023-03-22 21:15:04 -07:00
Kinar RandGitHub 3afe4cafc4 Merge branch 'master' into face-stylizer-python 2023-03-23 09:27:52 +05:30
Sebastian SchmidtandCopybara-Service 1a7be8a4c1 Internal change
PiperOrigin-RevId: 518747623
2023-03-22 20:44:34 -07:00
MediaPipe TeamandCopybara-Service 37111e8fa5 Internal change
PiperOrigin-RevId: 518657355
2023-03-22 13:29:29 -07:00
Sebastian SchmidtandCopybara-Service eda8cb6b42 Typo fix
PiperOrigin-RevId: 518603982
2023-03-22 10:20:06 -07:00
MediaPipe TeamandCopybara-Service cb2ee87705 Internal change
PiperOrigin-RevId: 518591192
2023-03-22 09:34:23 -07:00
Jiuqiang TangandCopybara-Service 21e0ff3d4e Skip unnecessary cpu<->gpu conversion if the input and output are already on the same storage.
PiperOrigin-RevId: 518573284
2023-03-22 08:22:38 -07:00
MediaPipe TeamandCopybara-Service 18b4caa7f3 Internal change
PiperOrigin-RevId: 518559368
2023-03-22 07:14:18 -07:00
Kinar RandGitHub 3c39aca52b Merge branch 'google:master' into audio-record-api-python 2023-03-22 11:46:28 +05:30
kinaryml 444cd00ee6 Moved audio_record.py to tasks/python/audio/core 2023-03-21 23:15:55 -07:00
Copybara-Service 5d2a719b54 Merge pull request #4027 from kinaryml:cosine-sim-python
PiperOrigin-RevId: 518431807
2023-03-21 17:59:48 -07:00
Sebastian SchmidtandCopybara-Service 788e8d8777 Fix crash when FaceLandmarker does not return a result
PiperOrigin-RevId: 518410060
2023-03-21 16:21:58 -07:00
Sebastian SchmidtandCopybara-Service bbd21e9a6d Add the FaceStylizer Web API
PiperOrigin-RevId: 518409812
2023-03-21 16:17:28 -07:00
Jiuqiang TangandCopybara-Service b71e1d14d3 Add missing dependency library targets to mediapipe_task_aar.
PiperOrigin-RevId: 518384666
2023-03-21 14:38:11 -07:00
Sebastian SchmidtandCopybara-Service 8bbf2621a4 Typo fix
PiperOrigin-RevId: 518380030
2023-03-21 14:31:49 -07:00
Sebastian SchmidtandCopybara-Service a5fc1d4baf Use Uint8ClampedArray for pixel output
PiperOrigin-RevId: 518362677
2023-03-21 13:22:10 -07:00
MediaPipe TeamandCopybara-Service 7d26daf723 Make sure calling GraphTextureFrame::getTextureName()+::release() on a non-GL thread doesn't result in a crash.
PiperOrigin-RevId: 518359778
2023-03-21 13:12:03 -07:00
MediaPipe TeamandCopybara-Service 88effb19e5 Add build variants for _gms to some MediaPipe libraries that use TFLite
This change alters some cc_library to cc_library_with_tflite to add _gms variants to some select MediaPipe libraries. This CL also makes minimal changes in the code to make the _gms variants buildable.

PiperOrigin-RevId: 518336242
2023-03-21 11:48:09 -07:00
Jiuqiang TangandCopybara-Service 384f77b5c3 Fix the proto src file names.
PiperOrigin-RevId: 518332541
2023-03-21 11:34:39 -07:00
MediaPipe TeamandCopybara-Service c2a3e99545 Internal change
PiperOrigin-RevId: 518330697
2023-03-21 11:29:04 -07:00
MediaPipe TeamandCopybara-Service 2be66e8eb0 Add interactive segmenter java API
PiperOrigin-RevId: 518303391
2023-03-21 09:59:19 -07:00
Copybara-Service 6e0542c16a Merge pull request #4141 from priankakariatyml:ios-image-classifier-impl-files
PiperOrigin-RevId: 518138209
2023-03-20 19:05:37 -07:00
Jiuqiang TangandCopybara-Service 5a924669b7 Temporarily disabling checking whether the executor is not set in a subgraph node. This is a workaround to allow the MediaPipe InferenceCalculator to have its own executor.
PiperOrigin-RevId: 518117759
2023-03-20 17:10:55 -07:00
Sebastian SchmidtandCopybara-Service 2651d30ebf Add ImageData output to GraphRunner
PiperOrigin-RevId: 517994561
2023-03-20 09:46:27 -07:00
Copybara-Service 54e4dfc853 Merge pull request #4177 from kinaryml:face-landmarker-python
PiperOrigin-RevId: 517979421
2023-03-20 08:47:47 -07:00
MediaPipe TeamandCopybara-Service 47fa1a9578 Internal change
PiperOrigin-RevId: 517886450
2023-03-20 00:25:47 -07:00
MediaPipe TeamandCopybara-Service 524acaaaa7 internal change
PiperOrigin-RevId: 517823184
2023-03-19 16:07:32 -07:00
Jiuqiang TangandCopybara-Service f06e4224b8 Allow ModelResourcesCalculator to use file_pointer_meta.
PiperOrigin-RevId: 517742722
2023-03-19 01:33:52 -07:00
MediaPipe TeamandCopybara-Service 2e5ea174fe Internal change
PiperOrigin-RevId: 517597924
2023-03-18 00:29:59 -07:00
Jiuqiang TangandCopybara-Service 6634d22161 Add LabelMapProto.java source code to MediaPipe AAR.
PiperOrigin-RevId: 517563190
2023-03-17 19:49:53 -07:00
Jiuqiang TangandCopybara-Service 6785bcc47d Add java_package and java_outer_classname to label_map.proto.
PiperOrigin-RevId: 517563000
2023-03-17 19:45:45 -07:00
Jiuqiang TangandCopybara-Service 065f1f38aa Fix the vision tasks aar build rule to solve the "cannot find symbol" error:
```
mediapipe/tasks/java/com/google/mediapipe/tasks/vision/imagesegmenter/ImageSegmenter.java:28: error: cannot find symbol
import com.google.mediapipe.tasks.TensorsToSegmentationCalculatorOptionsProto;
```

PiperOrigin-RevId: 517542284
2023-03-17 17:02:22 -07:00
Jiuqiang TangandCopybara-Service 0805d61bfe Add the source code TensorsToSegmentationCalculatorOptionsProto.java into tasks core's maven package.
PiperOrigin-RevId: 517516701
2023-03-17 15:01:33 -07:00
MediaPipe TeamandCopybara-Service 3dede1a9a5 Add label_map filtering into filter_detection drishti calculator.
PiperOrigin-RevId: 517515046
2023-03-17 14:53:48 -07:00
MediaPipe TeamandCopybara-Service 1a456dcbf9 Internal change
PiperOrigin-RevId: 517466009
2023-03-17 11:40:26 -07:00
MediaPipe TeamandCopybara-Service 24217e2ead Internal change
PiperOrigin-RevId: 517322105
2023-03-16 22:50:22 -07:00
kinaryml 1ba285d916 Updated a method name in face_landmarker_test.py 2023-03-16 15:10:39 -07:00
Sebastian SchmidtandCopybara-Service 75bc44d42a Add a comment to macos_opencv so it can be easily replaced with sed
PiperOrigin-RevId: 517225588
2023-03-16 14:19:14 -07:00
MediaPipe TeamandCopybara-Service 560945ad39 Internal Changes
PiperOrigin-RevId: 517219631
2023-03-16 13:58:02 -07:00
kinaryml 94dba82284 Renamed a test method to use the plural form 2023-03-16 12:54:38 -07:00
kinaryml b36b0bb3e8 Updated API and tests 2023-03-16 12:51:19 -07:00
kinaryml 2753c79fde Removed MatrixData dataclass and used NumPy to represent Matrix 2023-03-16 11:50:07 -07:00
MediaPipe TeamandCopybara-Service a9e956baa1 Add more details to the invoke call trace.
It is always useful information to know if the TPU invoke is Async or not, and if the GPU invoke on the old path or new path.
This can make it obvious in the perfetto trace.

PiperOrigin-RevId: 517162515
2023-03-16 10:37:32 -07:00
MediaPipe TeamandCopybara-Service 3b66ac0623 Import the saved Keras models of BlazeFaceStylizer components into MediaPipe model maker.
PiperOrigin-RevId: 517044265
2023-03-16 00:44:06 -07:00
kinaryml 9aea1be6f9 Removed geometry pipeline calculator 2023-03-15 23:51:12 -07:00
Kinar RandGitHub 15d90bd325 Merge branch 'master' into face-landmarker-python 2023-03-16 12:17:59 +05:30
Copybara-Service d84ccbadad Merge pull request #4158 from kinaryml:face-detector-python
PiperOrigin-RevId: 516970627
2023-03-15 17:13:37 -07:00
MediaPipe TeamandCopybara-Service 8f1ce5fef6 Add quality test for InteractiveSegmenter
PiperOrigin-RevId: 516968294
2023-03-15 17:02:34 -07:00
MediaPipe TeamandCopybara-Service 61bcddc671 Add Interactive Segmenter MediaPipe Task
PiperOrigin-RevId: 516954589
2023-03-15 16:05:18 -07:00
Sebastian SchmidtandCopybara-Service 43082482f8 Remove framework:Cocoa again
PiperOrigin-RevId: 516928735
2023-03-15 14:24:15 -07:00
MediaPipe TeamandCopybara-Service 59962bed27 ImageSegmenterGraph set activation type from metadata, and remove the activation config in C++ ImageSegmenterOptions.
PiperOrigin-RevId: 516893115
2023-03-15 12:13:00 -07:00
MediaPipe TeamandCopybara-Service a323825134 Internal change
PiperOrigin-RevId: 516882513
2023-03-15 11:35:49 -07:00
MediaPipe TeamandCopybara-Service 18d88c531a Internal MediaPipe Tasks change.
PiperOrigin-RevId: 516881879
2023-03-15 11:30:58 -07:00
MediaPipe TeamandCopybara-Service ce3cd94f45 Internal change
PiperOrigin-RevId: 516871638
2023-03-15 10:56:32 -07:00
kinaryml 80dd764605 Removed dummy packet creation and preserved face_geometry protobuf import 2023-03-15 10:52:16 -07:00
kinaryml 4a6015e65c Fixed some issues in the MatrixData container, revised the implementation and added more tests 2023-03-15 10:41:36 -07:00
kinaryml 06c37c6442 Updated mediapipe/python/BUILD and tests 2023-03-15 09:11:06 -07:00
Kinar RandGitHub 2af660321d Merge branch 'google:master' into face-landmarker-python 2023-03-15 21:22:35 +05:30
Fergus HendersonandCopybara-Service 04ffb8432e Fix typo.
PiperOrigin-RevId: 516834369
2023-03-15 08:41:40 -07:00
Sebastian SchmidtandCopybara-Service c8b56439af Fix typo
PiperOrigin-RevId: 516758040
2023-03-15 01:38:55 -07:00
Kinar RandGitHub 647db21fc3 Merge branch 'google:master' into face-landmarker-python 2023-03-15 11:03:15 +05:30
kinaryml d83f400b08 Updated API and tests 2023-03-14 22:32:39 -07:00
MediaPipe TeamandCopybara-Service f517eddce1 API for c++ ImageSegmenter to get labels
PiperOrigin-RevId: 516714139
2023-03-14 21:13:08 -07:00
MediaPipe TeamandCopybara-Service cafff14135 GeometryPipelineCalculator support single face landmarks input.
PiperOrigin-RevId: 516701488
2023-03-14 20:03:07 -07:00
MediaPipe TeamandCopybara-Service 141cf843ae Add getLabels to ImageSegmeter Java API
PiperOrigin-RevId: 516683339
2023-03-14 18:04:33 -07:00
Yuqi LiandCopybara-Service 51d9640d88 Add metadata writer for image segmentation.
PiperOrigin-RevId: 516671364
2023-03-14 17:00:30 -07:00
MediaPipe TeamandCopybara-Service 9a89b47572 Rename *ModelFile to *File for methods of ModelAssetBundleResources.
PiperOrigin-RevId: 516667461
2023-03-14 16:42:32 -07:00
Jiuqiang TangandCopybara-Service cd2cc971bb Registering FaceGeometry proto.
PiperOrigin-RevId: 516663848
2023-03-14 16:28:48 -07:00
Sebastian SchmidtandCopybara-Service f60fe739d3 Internal change
PiperOrigin-RevId: 516656029
2023-03-14 15:57:01 -07:00
Sebastian SchmidtandCopybara-Service 3e952a5f1f Update Node version to 16.19.0
PiperOrigin-RevId: 516654979
2023-03-14 15:52:32 -07:00
Sebastian SchmidtandCopybara-Service ec3cd45d61 Add InteractiveSegmenter Web API
PiperOrigin-RevId: 516654090
2023-03-14 15:48:38 -07:00
MediaPipe TeamandCopybara-Service 6774794d02 Add the dataset module for face stylizer in model maker.
PiperOrigin-RevId: 516628350
2023-03-14 14:11:20 -07:00
Hadon NashandCopybara-Service ade31b567b Internal change
PiperOrigin-RevId: 516626371
2023-03-14 14:04:57 -07:00
MediaPipe TeamandCopybara-Service ed3e728bb8 Internal change
PiperOrigin-RevId: 516607678
2023-03-14 12:57:24 -07:00
Jiuqiang TangandCopybara-Service fef8b9cb58 Registering FaceGeometry proto.
PiperOrigin-RevId: 516597971
2023-03-14 12:21:02 -07:00
MediaPipe TeamandCopybara-Service 854ab25ee9 Internal change.
PiperOrigin-RevId: 516594221
2023-03-14 12:11:18 -07:00
MediaPipe TeamandCopybara-Service 8a41a5e44d Update models.
PiperOrigin-RevId: 516575530
2023-03-14 11:06:20 -07:00
Sebastian SchmidtandCopybara-Service 5bba1f245f Internal change
PiperOrigin-RevId: 516550977
2023-03-14 09:46:41 -07:00
MediaPipe TeamandCopybara-Service c895867427 Expose FrameBuffer view on GpuBufferStorageYuvImage.
PiperOrigin-RevId: 516546716
2023-03-14 09:30:25 -07:00
MediaPipe TeamandCopybara-Service 2659ea0392 Internal change
PiperOrigin-RevId: 516535124
2023-03-14 08:44:40 -07:00
Alan KellyandCopybara-Service bc641a22a8 Internal change
PiperOrigin-RevId: 516520860
2023-03-14 07:41:20 -07:00
kinaryml 23681cde0d Revised face landmarker implementation and tests 2023-03-14 00:37:32 -07:00
Kinar RandGitHub 4a7489cd3a Merge branch 'google:master' into face-landmarker-python 2023-03-14 11:27:52 +05:30
MediaPipe TeamandCopybara-Service 46ba1d8051 Use ExternalFile to set metadata of GeometryPipelineCalculator.
PiperOrigin-RevId: 516384491
2023-03-13 18:50:33 -07:00
Jiuqiang TangandCopybara-Service 57f106e0a7 Wait until the metal backend finishes its work in the TensorsToImageCalculator.
PiperOrigin-RevId: 516360846
2023-03-13 16:56:46 -07:00
MediaPipe TeamandCopybara-Service 89857f33a2 Make ImageToTensorCalculator use kGpuService optionally
PiperOrigin-RevId: 516358053
2023-03-13 16:48:49 -07:00
Chris McClanahanandCopybara-Service 1b4a835be0 Internal change
PiperOrigin-RevId: 516349788
2023-03-13 16:09:56 -07:00
Sebastian SchmidtandCopybara-Service cb4b0ea93d Disable OpenCL dependency for OpenCV
PiperOrigin-RevId: 516341303
2023-03-13 15:37:53 -07:00
Esha UbowejaandCopybara-Service 0f58d89992 Preserves all elements of BASE_HAND_RECTS input streams in HandAssociationCalculator.
PiperOrigin-RevId: 516339343
2023-03-13 15:32:35 -07:00
Sebastian SchmidtandCopybara-Service c32ddcb04c Add alwayslink to face_stylizer_graph
PiperOrigin-RevId: 516330940
2023-03-13 14:58:39 -07:00
Sebastian SchmidtandCopybara-Service eac2e337f6 Sort vision tasks in README.md
PiperOrigin-RevId: 516312229
2023-03-13 13:53:20 -07:00
Sebastian SchmidtandCopybara-Service 85600ca326 Add Keypoint and Region-of-interest
PiperOrigin-RevId: 516299794
2023-03-13 13:10:40 -07:00
Sebastian SchmidtandCopybara-Service 490d1a7516 Refactor Web code for InteractiveSegmenter
PiperOrigin-RevId: 516254891
2023-03-13 10:43:24 -07:00
Copybara-Service d6fb7c365e Merge pull request #4145 from lucifertrj:poseDocs
PiperOrigin-RevId: 516231033
2023-03-13 09:22:34 -07:00
kinaryml efae2830f1 Updated face landmarker implementation and tests 2023-03-13 08:46:41 -07:00
Jiuqiang TangandCopybara-Service 1d2041b992 Internal change
PiperOrigin-RevId: 516220827
2023-03-13 08:43:21 -07:00
MediaPipe TeamandCopybara-Service ffea85e470 Internal change
PiperOrigin-RevId: 516179167
2023-03-13 05:13:01 -07:00
kinaryml 89be4c7b64 Added some files for the face landmarker implementation 2023-03-12 16:09:04 -07:00
MediaPipe TeamandCopybara-Service 131be2169a Add FaceDetector Java API
PiperOrigin-RevId: 515913662
2023-03-11 13:14:47 -08:00
MediaPipe TeamandCopybara-Service 296ee33be5 Add FaceLandmarker C++ API
PiperOrigin-RevId: 515912777
2023-03-11 13:05:21 -08:00
kinaryml 78e48825ae Make create_audio_record not a static method 2023-03-11 07:39:34 -08:00
MediaPipe TeamandCopybara-Service c94de4032d Fix preprocess Callable typing
PiperOrigin-RevId: 515818356
2023-03-10 21:50:46 -08:00
Jiuqiang TangandCopybara-Service 3e8fd58400 Make createAudioRecord a class method not a static method.
PiperOrigin-RevId: 515740313
2023-03-10 14:34:32 -08:00
Sebastian SchmidtandCopybara-Service db779ba78f Use drishti_proto_library for libraries in mediapipe/gpu
PiperOrigin-RevId: 515708036
2023-03-10 12:27:06 -08:00
MediaPipe TeamandCopybara-Service c9bd4f5957 Internal change
PiperOrigin-RevId: 515706419
2023-03-10 12:22:27 -08:00
MediaPipe TeamandCopybara-Service c3a32d76be Update face geometry proto java package name.
PiperOrigin-RevId: 515696170
2023-03-10 11:45:35 -08:00
MediaPipe TeamandCopybara-Service 296c343332 Revise the Halide Bazel build rules to be cleaner and more correct. The initial version we landed happened to work (at least in most cases) but had known workarounds in it. AFAICT, the issue seemed to be that the MediaPipe config_setting() values we were using didn't always resolve to the right thing when detecting the host cpu (vs the compile-target cpu), which is critical for Halide. I fixed this by avoiding the use of the MediaPipe config_settings entirely, using instead the public Bazel settings hosted at https://github.com/bazelbuild/platforms.
This revision builds and runs //mediapipe/util/frame_buffer:all correctly on my mac x86-64 laptop; I haven't yet attempted to build or test on any other platform, so there may well still be glitches, but I think this is more fundamentally sound than what we had before.

PiperOrigin-RevId: 515682507
2023-03-10 10:59:17 -08:00
Kinar RandGitHub 9d82000148 Update BUILD 2023-03-11 00:04:07 +05:30
Kinar RandGitHub f56a3088e3 Update audio_record_test.py 2023-03-11 00:02:41 +05:30
kinaryml 9787056508 Added the AudioRecord API 2023-03-10 10:17:03 -08:00
MediaPipe TeamandCopybara-Service 05b505c8e2 Introduce api to disable service default initialization.
PiperOrigin-RevId: 515501608
2023-03-09 18:57:39 -08:00
Sebastian SchmidtandCopybara-Service ef4a8cde42 Solve iOS build error for gpu_buffer.cc
PiperOrigin-RevId: 515473643
2023-03-09 16:28:58 -08:00
MediaPipe TeamandCopybara-Service 2d8f937913 Improve docstring of image classifier model spec.
PiperOrigin-RevId: 515466722
2023-03-09 16:06:40 -08:00
Sebastian SchmidtandCopybara-Service 517e997179 Solve Linking error for Hello World iOS example
PiperOrigin-RevId: 515466634
2023-03-09 16:02:07 -08:00
MediaPipe TeamandCopybara-Service c2a69ab476 Update ImageFrameToGpuBufferCalculator to use api2 and GpuBuffer conversions
PiperOrigin-RevId: 515407159
2023-03-09 12:21:00 -08:00
MediaPipe TeamandCopybara-Service 5daf58009d internal
PiperOrigin-RevId: 515392932
2023-03-09 11:27:11 -08:00
Jiuqiang TangandCopybara-Service 5bd6a7082a Add requiredInputBufferSize as an input argument of createAudioRecord.
PiperOrigin-RevId: 515374407
2023-03-09 10:30:49 -08:00
MediaPipe TeamandCopybara-Service 563b193bca Bump Halide version from 14.0.0 to 15.0.0 and add MacOS Halide dependency
PiperOrigin-RevId: 515362310
2023-03-09 09:54:19 -08:00
MediaPipe TeamandCopybara-Service 2c64421471 Fix minor typos in MediaPipe synchronization description.
PiperOrigin-RevId: 515362264
2023-03-09 09:49:23 -08:00
MediaPipe TeamandCopybara-Service 39e2c8351f Add build system for Halide and expose FrameBufferUtils.
PiperOrigin-RevId: 515304264
2023-03-09 05:06:18 -08:00
kinaryml 7463e48fd4 Added some files necessary for the Face Stylizer implementation 2023-03-09 02:39:21 -08:00
kinaryml f48909cab6 Fixed score's data type 2023-03-09 02:13:34 -08:00
kinaryml 24114ec2fe Updated comment in test 2023-03-09 01:41:42 -08:00
kinaryml 022838a7f3 Added Face Detector implementation and tests 2023-03-09 01:36:39 -08:00
Sebastian SchmidtandCopybara-Service 5398b8881d Internal change
PiperOrigin-RevId: 515225596
2023-03-08 21:04:55 -08:00
MediaPipe TeamandCopybara-Service c12eae229f Internal change
PiperOrigin-RevId: 515187906
2023-03-08 17:36:04 -08:00
MediaPipe TeamandCopybara-Service 8d9f627fd9 Internal change
PiperOrigin-RevId: 515187139
2023-03-08 17:32:21 -08:00
MediaPipe TeamandCopybara-Service 9f1f4273d0 Support hair segmentation model in image segmenter
PiperOrigin-RevId: 515151150
2023-03-08 15:01:14 -08:00
MediaPipe TeamandCopybara-Service 2fb62e4c29 Add volume_gain_db option to TensorsToAudioCalculator.
PiperOrigin-RevId: 515150234
2023-03-08 14:57:29 -08:00
Jiuqiang TangandCopybara-Service 253a5b477e Implement face stylizer graph and its C++ API.
PiperOrigin-RevId: 515139282
2023-03-08 14:18:08 -08:00
Kris TonthatandCopybara-Service 0a60c67667 Redirect "Getting started pages" from MediaPipe.dev to developers.google.com/mediapipe
PiperOrigin-RevId: 515137109
2023-03-08 14:10:45 -08:00
Yuqi LiandCopybara-Service 6f8c30abdd nit: update the description format in object_detector.MetadataWriter.
PiperOrigin-RevId: 515113799
2023-03-08 12:46:08 -08:00
MediaPipe TeamandCopybara-Service b8917ad31f Add FaceDetectorResult
PiperOrigin-RevId: 515104977
2023-03-08 12:10:13 -08:00
Sebastian SchmidtandCopybara-Service 09f63cbbe0 Internal change
PiperOrigin-RevId: 515094293
2023-03-08 11:33:38 -08:00
Jiuqiang TangandCopybara-Service ddc535e705 Add DftTensorFormat To TensorsToAudioCalculatorOptions.
PiperOrigin-RevId: 515077766
2023-03-08 10:38:40 -08:00
Hadon NashandCopybara-Service 16c2e32a0d Internal change
PiperOrigin-RevId: 515044500
2023-03-08 08:29:53 -08:00
MediaPipe TeamandCopybara-Service 13d7e1a7ba Changes the visibility of ImageTensorSpecs to public to allow clients use GetInputImageTensorSpecs().
PiperOrigin-RevId: 514853148
2023-03-07 15:16:40 -08:00
MediaPipe TeamandCopybara-Service 225dd36a63 Internal change
PiperOrigin-RevId: 514835354
2023-03-07 14:11:47 -08:00
Yuqi LiandCopybara-Service 46b5c4012d add custom metadata in metadata_schema.
PiperOrigin-RevId: 514768756
2023-03-07 10:15:09 -08:00
MediaPipe TeamandCopybara-Service 414031867e Internal change
PiperOrigin-RevId: 514763674
2023-03-07 10:00:10 -08:00
Jiuqiang TangandCopybara-Service dbd6d72696 Add GetInputImageTensorSpecs into BaseVisionTaskApi for tasks api users to get input image tensor specifications.
PiperOrigin-RevId: 514650593
2023-03-07 00:44:07 -08:00
MediaPipe TeamandCopybara-Service 2f2a74da6a Internal MediaPipe Tasks change.
PiperOrigin-RevId: 514637484
2023-03-06 23:17:35 -08:00
MediaPipe TeamandCopybara-Service c1b460920c normalized keypoint container. Detection adds optional keypoint list.
PiperOrigin-RevId: 514624925
2023-03-06 22:02:59 -08:00
MediaPipe TeamandCopybara-Service e4ac1a10c2 TensorsToSegmentation web postprocessing on GPU: softmax activation
PiperOrigin-RevId: 514589911
2023-03-06 19:08:53 -08:00
MediaPipe TeamandCopybara-Service bd9a2ee1fc Internal change
PiperOrigin-RevId: 514580892
2023-03-06 18:13:50 -08:00
MediaPipe TeamandCopybara-Service 0337c7f52f Fix typo in ImageSegmenter.java
PiperOrigin-RevId: 514534013
2023-03-06 14:51:49 -08:00
MediaPipe TeamandCopybara-Service f15244997f Internal change
PiperOrigin-RevId: 514498364
2023-03-06 12:58:01 -08:00
Jiuqiang TangandCopybara-Service 77fcaa9597 Allow TensorsToAudioCalculator to add and overlay adjacent windows.
PiperOrigin-RevId: 514483756
2023-03-06 12:08:57 -08:00
MediaPipe TeamandCopybara-Service c64f83fff4 Internal change
PiperOrigin-RevId: 514452059
2023-03-06 10:29:29 -08:00
MediaPipe TeamandCopybara-Service 6c68d4c358 Internal change
PiperOrigin-RevId: 514421618
2023-03-06 08:42:19 -08:00
MediaPipe TeamandCopybara-Service 96b2958f18 Add ViewProvider for ImageFrame in GpuBufferStorageYuvImage.
PiperOrigin-RevId: 514344066
2023-03-06 07:53:02 -08:00
MediaPipe TeamandCopybara-Service a43be73ee4 Internal MediaPipe Tasks change.
PiperOrigin-RevId: 514150403
2023-03-06 07:32:59 -08:00
MediaPipe TeamandCopybara-Service 763842289a Add FaceLandmarkerResult for FaceLandmarker API
PiperOrigin-RevId: 514137566
2023-03-06 07:31:30 -08:00
MediaPipe TeamandCopybara-Service cd14d2e688 Internal MediaPipe Tasks change.
PiperOrigin-RevId: 514002859
2023-03-06 07:29:55 -08:00
Yuqi LiandCopybara-Service dbe4175a08 Internal change
PiperOrigin-RevId: 514001732
2023-03-06 07:28:20 -08:00
MediaPipe TeamandCopybara-Service c98b4b6ec6 Internal change
PiperOrigin-RevId: 513992315
2023-03-06 07:26:39 -08:00
MediaPipe TeamandCopybara-Service 3d41eabc2e Face Detector C++ API
PiperOrigin-RevId: 513959349
2023-03-06 07:17:46 -08:00
MediaPipe TeamandCopybara-Service 5b2678a49f Add a CHECK for the cases when null service is accessed unconditionally.
PiperOrigin-RevId: 513956583
2023-03-06 07:16:29 -08:00
MediaPipe TeamandCopybara-Service 9c3abcd06f Document graph service usage with docs and unit tests.
PiperOrigin-RevId: 513955877
2023-03-06 07:15:10 -08:00
MediaPipe TeamandCopybara-Service 3854d9fcd5 Document proper way to set services.
PiperOrigin-RevId: 513955214
2023-03-06 07:13:54 -08:00
MediaPipe TeamandCopybara-Service 2963739086 Internal MediaPipe Tasks change.
PiperOrigin-RevId: 513897822
2023-03-06 07:12:37 -08:00
Yuqi LiandCopybara-Service fe92d2e781 Metadata Writer: add object detection metadata writer.
PiperOrigin-RevId: 513897494
2023-03-06 07:11:10 -08:00
Sebastian SchmidtandCopybara-Service 13db1c55d3 Make Bert/RegexTokenizerTest pass on Windows
PiperOrigin-RevId: 513887535
2023-03-06 07:04:30 -08:00
Tarun JainandGitHub 54e597216b np used in the program but not imported 2023-03-04 22:58:12 +05:30
MediaPipe TeamandCopybara-Service b7ec83efb5 Add optional face blendshapes to face landmarks detector graph.
PiperOrigin-RevId: 513867488
2023-03-03 10:48:55 -08:00
Hadon NashandCopybara-Service c9c1bf21ae Internal change
PiperOrigin-RevId: 513854481
2023-03-03 10:00:10 -08:00
Prianka Liz Kariat 87df23f0fa Updated formatting of MPPRunningMode.h 2023-03-03 14:40:00 +05:30
Prianka Liz Kariat 7b8d92ba47 Updated formatting in MPPVisionTaskRunner 2023-03-03 14:39:22 +05:30
Prianka Liz Kariat 412476eba1 Added inline function to return display name of MPPRunningMode 2023-03-03 14:39:03 +05:30
Prianka Liz Kariat f2dfa7f474 Updated documentation of MPPVisionTaskRunner 2023-03-03 12:33:31 +05:30
Prianka Liz Kariat 160fa424b5 Updated documentation of MPPTaskRunner 2023-03-03 12:33:17 +05:30
Prianka Liz Kariat fee66069ac Updated error with info about unsupported mirrored orientations in MPPVisionTaskRunner 2023-03-03 12:19:14 +05:30
Prianka Liz Kariat 6253966901 Updated comments in MPPTaskRunner to include note about mirrored orientations 2023-03-03 12:15:25 +05:30
Prianka Liz Kariat 289b3b20de Added methods for common functionality in MPPImageClassifier 2023-03-03 12:01:45 +05:30
Prianka Liz Kariat 8aaabe4a02 Updated comments in MPPVisionTaskRunner 2023-03-03 11:18:36 +05:30
Prianka Liz Kariat d577727698 Updated MPPImageClassifier 2023-03-03 11:11:07 +05:30
Prianka Liz Kariat af82dc5e17 Updated comments in MPPImageClassifier 2023-03-03 11:10:20 +05:30
Prianka Liz Kariat 4b54f7f45f Fixed comments in MPPVisionTaskRunner 2023-03-03 10:57:39 +05:30
MediaPipe TeamandCopybara-Service 3837c92fd5 Add functions for checking the existence of options in subgraphs and calculators.
PiperOrigin-RevId: 513689742
2023-03-02 18:01:07 -08:00
MediaPipe TeamandCopybara-Service 91d53cd181 Make image preprocessing support RGBA image.
PiperOrigin-RevId: 513680594
2023-03-02 17:13:19 -08:00
Sebastian SchmidtandCopybara-Service c3adf19706 Invoke vector listeners for zero-element vectors
PiperOrigin-RevId: 513662913
2023-03-02 15:59:26 -08:00
Sebastian SchmidtandCopybara-Service 7664e0ef64 Make SentencePieceTokenizerTest work on Windows
PiperOrigin-RevId: 513638600
2023-03-02 14:23:22 -08:00
MediaPipe TeamandCopybara-Service 945b36766c Let web API add empty packets to input streams
PiperOrigin-RevId: 513630040
2023-03-02 13:51:39 -08:00
MediaPipe TeamandCopybara-Service 0ba35cf1a7 Internal change
PiperOrigin-RevId: 513608516
2023-03-02 12:29:06 -08:00
MediaPipe TeamandCopybara-Service c71f78c38f Internal change
PiperOrigin-RevId: 513607664
2023-03-02 12:24:51 -08:00
MediaPipe TeamandCopybara-Service dd4301802a migrate env_generator_calculator
PiperOrigin-RevId: 513585830
2023-03-02 11:05:02 -08:00
MediaPipe TeamandCopybara-Service 02ee934b3e When "--define=MEDIAPIPE_NO_JNI=1" used in compilation, no implementation in libandroid.so is used.
PiperOrigin-RevId: 513580575
2023-03-02 10:46:35 -08:00
Tarun JainandGitHub 38ec8ae842 link updated 2023-03-02 21:04:53 +05:30
Tarun JainandGitHub 6e7018b826 Merge branch 'google:master' into master 2023-03-02 21:01:21 +05:30
Prianka Liz Kariat 09fa23088a Added TODO 2023-03-02 20:01:48 +05:30
Prianka Liz Kariat 33a34de03b Updated method signature in MPPTaskRunner 2023-03-02 19:50:00 +05:30
Prianka Liz Kariat fe7bb92859 Added dependency for image format 2023-03-02 19:49:42 +05:30
Prianka Liz Kariat 6eafddb8e2 Added MPPImageClassifier 2023-03-02 19:46:20 +05:30
Prianka Liz Kariat ee6171c833 Added MPPImageClassifierOptionsHelpers 2023-03-02 19:46:11 +05:30
Prianka Liz Kariat abb140ed2e Added MPPImageClassifierResultHelpers 2023-03-02 19:45:58 +05:30
Prianka Liz Kariat c871fc58ec Updated build targets of vision packet creator and task runner 2023-03-02 19:43:46 +05:30
Prianka Liz Kariat c625d6afdc Added methods to MPPVisionPacketCreator 2023-03-02 19:43:22 +05:30
Prianka Liz Kariat dc393b0bd4 Added methods to MPPVisionTaskRunner 2023-03-02 19:43:01 +05:30
Prianka Liz Kariat b76ab37394 Removed unwanted imports 2023-03-02 19:37:24 +05:30
Prianka Liz Kariat 045050fc85 Changed method Updated method calls to process packet map in iOS text tasks 2023-03-02 19:36:34 +05:30
Prianka Liz Kariat 6d7f172e9f Changed return type of process method in MPPTaskRunner 2023-03-02 19:35:05 +05:30
Prianka Liz Kariat 87ba86ace2 Added method to send packet map to C++ task runner 2023-03-02 19:34:44 +05:30
MediaPipe TeamandCopybara-Service 6796977a04 migrate geometry_pipeline_calculator
PiperOrigin-RevId: 513368520
2023-03-01 16:09:48 -08:00
Sebastian SchmidtandCopybara-Service f15637b62c Make Metadata tests pass on Windows
PiperOrigin-RevId: 513365428
2023-03-01 15:59:43 -08:00
Copybara-Service 82ee00f25d Merge pull request #4118 from kuaashish:master
PiperOrigin-RevId: 513364683
2023-03-01 15:55:37 -08:00
Sebastian SchmidtandCopybara-Service abfcd8ec1d Make LoadBinaryContent work on Windows
PiperOrigin-RevId: 513330348
2023-03-01 13:49:02 -08:00
Joe FernandezandCopybara-Service 07fa5c2fc8 Internal change
PiperOrigin-RevId: 513300452
2023-03-01 11:56:26 -08:00
MediaPipe TeamandCopybara-Service 22fce9e136 migrate mediapipe/modules/face_geometry to mediapipe/tasks
PiperOrigin-RevId: 513284254
2023-03-01 10:59:56 -08:00
Joe FernandezandCopybara-Service 0a937eba98 Internal change
PiperOrigin-RevId: 513255798
2023-03-01 09:21:25 -08:00
Sebastian SchmidtandCopybara-Service 22f186724e Make delegate sticky
PiperOrigin-RevId: 513249729
2023-03-01 09:00:36 -08:00
Sebastian SchmidtandCopybara-Service 4a1ba11e3f Do not use designated initializers
PiperOrigin-RevId: 513028900
2023-02-28 13:52:36 -08:00
Jiuqiang TangandCopybara-Service 172b360478 Remove unused variable 'input_num'.
PiperOrigin-RevId: 513009671
2023-02-28 12:37:03 -08:00
MediaPipe TeamandCopybara-Service 2143baf7d5 Dos/Donts: separating nodes for readability
PiperOrigin-RevId: 512994288
2023-02-28 11:40:03 -08:00
Copybara-Service f1b20b0c52 Merge pull request #4104 from priankakariatyml:ios-image-classifier
PiperOrigin-RevId: 512991238
2023-02-28 11:29:19 -08:00
Jiuqiang TangandCopybara-Service 646ab8505a Small fixes to TensorsToImageCalculator.
PiperOrigin-RevId: 512967357
2023-02-28 10:11:42 -08:00
Sebastian SchmidtandCopybara-Service 06dd003113 Internal change
PiperOrigin-RevId: 512777889
2023-02-27 17:34:29 -08:00
MediaPipe TeamandCopybara-Service bfddb32358 remove usage of var for ImageSegmenter.java
PiperOrigin-RevId: 512767947
2023-02-27 16:49:27 -08:00
Kris TonthatandCopybara-Service 2cbaf84f50 Internal change
PiperOrigin-RevId: 512758617
2023-02-27 16:12:26 -08:00
Sebastian SchmidtandCopybara-Service 689d5ba6e3 Internal
PiperOrigin-RevId: 512755713
2023-02-27 16:00:35 -08:00
Sebastian SchmidtandCopybara-Service 1dca871d09 Remove designated initializer use from CombinedPredictionCalculatorTestCase
PiperOrigin-RevId: 512747781
2023-02-27 15:28:34 -08:00
Sebastian SchmidtandCopybara-Service 1d927c5971 Internal change
PiperOrigin-RevId: 512709627
2023-02-27 13:08:04 -08:00
MediaPipe TeamandCopybara-Service a60d67eb10 Update ImageSegmenter API for image/video mode to have both callback API and returned result API.
PiperOrigin-RevId: 512697585
2023-02-27 12:21:30 -08:00
Jiuqiang TangandCopybara-Service aa61abe386 Implement TensorsToImageCalculator.
PiperOrigin-RevId: 512687103
2023-02-27 11:46:07 -08:00
MediaPipe TeamandCopybara-Service 5913e5dd1d Internal change
PiperOrigin-RevId: 512686714
2023-02-27 11:41:44 -08:00
MediaPipe TeamandCopybara-Service 75576700ed Add Bitmap image capture capability to GlSurfaceViewRenderer.
PiperOrigin-RevId: 512677893
2023-02-27 11:14:20 -08:00
Sebastian SchmidtandCopybara-Service 9f59d4d01b Remove cosineSimilarity() from AudioEmbedder
PiperOrigin-RevId: 512671255
2023-02-27 11:13:20 -08:00
MediaPipe TeamandCopybara-Service 39b2fec60f Internal change
PiperOrigin-RevId: 512643827
2023-02-27 11:12:20 -08:00
MediaPipe TeamandCopybara-Service 1575e7f79c Internal change
PiperOrigin-RevId: 512457466
2023-02-27 11:11:24 -08:00
MediaPipe TeamandCopybara-Service 17466fb7f1 Internal change
PiperOrigin-RevId: 512111461
2023-02-27 11:10:19 -08:00
MediaPipe Teamandjqtang 9054ff7283 Internal change
PiperOrigin-RevId: 511928038
2023-02-27 11:02:58 -08:00
Tarun JainandGitHub c73ff261ad Fix Broken Link in Object Detection solutions 2023-02-24 19:37:30 +05:30
MediaPipe TeamandCopybara-Service 01c64082f1 ImageToTensorCalculator decides the output tensor size in runtime from the input image size.
PiperOrigin-RevId: 511882195
2023-02-23 14:18:31 -08:00
MediaPipe TeamandCopybara-Service 0981367e84 DetectionTransformationCalculator handles empty input.
PiperOrigin-RevId: 511881969
2023-02-23 14:14:20 -08:00
Kris TonthatandCopybara-Service 0b989f8c8d Add legacy solutions note
PiperOrigin-RevId: 511880995
2023-02-23 14:09:41 -08:00
kuaashishandGitHub 86a2fa300b Update iris.md 2023-02-23 22:08:05 +05:30
kuaashishandGitHub f42b60e08f Update iris.md 2023-02-23 22:07:40 +05:30
kuaashishandGitHub 1c37010dde Update objectron.md 2023-02-23 22:07:04 +05:30
kuaashishandGitHub 48d72e7ddc Update face_mesh.md 2023-02-23 22:06:35 +05:30
kuaashishandGitHub 35d1b98433 Update objectron.md 2023-02-23 22:04:49 +05:30
kuaashishandGitHub 34e361f81e Update media_sequence.md 2023-02-23 22:04:02 +05:30
kuaashishandGitHub 488b1e23a0 Update troubleshooting.md 2023-02-23 22:01:58 +05:30
kuaashishandGitHub 9e37b520fb Update faq.md 2023-02-23 22:01:19 +05:30
kuaashishandGitHub abc8c73aee Update javascript.md 2023-02-23 22:00:01 +05:30
kuaashishandGitHub bc157ff990 Update help.md 2023-02-23 21:57:42 +05:30
MediaPipe TeamandCopybara-Service 75d799d2b9 Add Copyright head
PiperOrigin-RevId: 511694458
2023-02-22 22:47:02 -08:00
MediaPipe TeamandCopybara-Service ff10f3c814 Move NormalizedKeypoint to a separate header
PiperOrigin-RevId: 511642586
2023-02-22 17:42:06 -08:00
MediaPipe TeamandCopybara-Service 2c3c1e664a add TensorsToFaceLandmarksGraph to support two types of face mesh models.
PiperOrigin-RevId: 511626032
2023-02-22 16:22:13 -08:00
Yuqi LiandCopybara-Service 9e7950a69a Make each model file in the model asset bundle to be aligned relative to the start of the file (alignment = 4).
PiperOrigin-RevId: 511624410
2023-02-22 16:15:24 -08:00
MediaPipe TeamandCopybara-Service 40b0dc960a Internal Changes
PiperOrigin-RevId: 511604893
2023-02-22 14:55:03 -08:00
MediaPipe TeamandCopybara-Service 000aeeb036 Update face detector graph for downstream face landmarks graph.
PiperOrigin-RevId: 511566984
2023-02-22 12:31:57 -08:00
MediaPipe TeamandCopybara-Service fbbc13d756 update detection result to include optional keypoints.
PiperOrigin-RevId: 511538880
2023-02-22 10:50:58 -08:00
MediaPipe TeamandCopybara-Service c026f935bc Add @ to all references to files in WORKSPACE.bazel.
PiperOrigin-RevId: 511504265
2023-02-22 08:36:36 -08:00
MediaPipe TeamandCopybara-Service e2ac704428 internal change
PiperOrigin-RevId: 511338483
2023-02-21 16:40:37 -08:00
MediaPipe TeamandCopybara-Service 9a6d5e0444 Update MediaPipe TFLite code to use generic "shim" symbols and headers
PiperOrigin-RevId: 511265313
2023-02-21 11:58:32 -08:00
Prianka Liz Kariat 68fdf6b6cb Updated comment arguments in MPPImageUtils 2023-02-20 11:27:21 +05:30
Prianka Liz Kariat 4d2dd50703 Updated method name in MPPVisionPacketCreator 2023-02-20 11:23:04 +05:30
Jiuqiang TangandCopybara-Service 8a0830ce7b Add "java_package" and "java_outer_classname" to ImageTransformationCalculatorOptions.
PiperOrigin-RevId: 510720513
2023-02-18 16:58:56 -08:00
MediaPipe TeamandCopybara-Service d0aa98bd5f Internal change
PiperOrigin-RevId: 510570555
2023-02-17 18:50:05 -08:00
MediaPipe TeamandCopybara-Service 68ba9a6ebf [ImageTransformationCalculator]Add option to specify padding color
PiperOrigin-RevId: 510541473
2023-02-17 15:57:19 -08:00
MediaPipe TeamandCopybara-Service 37a825c98d graph utils functions.
PiperOrigin-RevId: 510513793
2023-02-17 13:54:46 -08:00
MediaPipe TeamandCopybara-Service 1a60a0e2d6 Use box_output_format to decide keypoint order
PiperOrigin-RevId: 510464960
2023-02-17 10:30:57 -08:00
MediaPipe TeamandCopybara-Service 223c504d81 Add note to installation doc for Debian distros
PiperOrigin-RevId: 510317890
2023-02-16 20:27:59 -08:00
MediaPipe TeamandCopybara-Service 4ed9f507ad Internal change
PiperOrigin-RevId: 510281435
2023-02-16 17:01:56 -08:00
Hadon NashandCopybara-Service 5f6bbdbce5 Internal change
PiperOrigin-RevId: 510243967
2023-02-16 14:26:46 -08:00
MediaPipe TeamandCopybara-Service 1b66fc2802 Fix Typo.
PiperOrigin-RevId: 510156746
2023-02-16 08:55:56 -08:00
MediaPipe TeamandCopybara-Service 152f66dfd3 This will fix the command to clone mediapipe in the Debian and Ubuntu, CentOS, Windows, Windows Subsystem for Linux (WSL), Docker. Doc command mentioned
is throwing error when directly copied and pasted in the terminal.

PiperOrigin-RevId: 510061887
2023-02-16 00:23:49 -08:00
MediaPipe TeamandCopybara-Service ba10ae8410 Add mediapipe tasks face blendshapes graph
PiperOrigin-RevId: 509995915
2023-02-15 19:26:56 -08:00
MediaPipe TeamandCopybara-Service bdd1c24990 Refactor common methods into vision/core/image_utils.py and vision/core/test_utils.py
PiperOrigin-RevId: 509968910
2023-02-15 16:54:38 -08:00
MediaPipe TeamandCopybara-Service 3d4ed305bc Make Tensor::Move() forward quantization parameters.
PiperOrigin-RevId: 509951145
2023-02-15 15:40:22 -08:00
MediaPipe TeamandCopybara-Service 796a96d842 Add support for [xmin, ymin, xmax, ymax] style of bbox output
PiperOrigin-RevId: 509942540
2023-02-15 15:06:52 -08:00
Prianka Liz Kariat 5e5a1a733f Updated imports 2023-02-16 01:37:50 +05:30
Prianka Liz Kariat dce81342b6 Updated imports of MPPImageUtils 2023-02-16 01:35:27 +05:30
Prianka Liz Kariat ae05c78443 Updated formatting 2023-02-16 01:33:33 +05:30
Prianka Liz Kariat 42e35503d9 Removed unwanted declarations in namespace 2023-02-16 01:31:51 +05:30
Prianka Liz Kariat a503fb53e0 Updated MPPVisionTaskRunner 2023-02-16 01:31:29 +05:30
Prianka Liz Kariat a0253274cc Added MPPVisionPacketCreator 2023-02-16 01:31:09 +05:30
Prianka Liz Kariat 8c3e3456a3 Added MPPImageClassifierOptions 2023-02-16 01:26:10 +05:30
Prianka Liz Kariat 825b30bccd Added MPPImageClassifierResult 2023-02-16 01:25:57 +05:30
Prianka Liz Kariat a128810564 Updated MPPImageUtils with methods to create image frame 2023-02-16 01:25:16 +05:30
MediaPipe TeamandCopybara-Service 40c3e72c9c Added note to [page](https://google.github.io/mediapipe/getting_started/ios.html#create-an-xcode-project) that the xcode version in script should be same as installed version
PiperOrigin-RevId: 509801311
2023-02-15 05:09:31 -08:00
Sebastian SchmidtandCopybara-Service d450a673c0 Open visibility of iOS TextClassifier & TextEmbedder
PiperOrigin-RevId: 509645638
2023-02-14 14:53:24 -08:00
MediaPipe TeamandCopybara-Service 63a57e2da3 Graph builder Dos and Donts / Nodes minimal direct usage
PiperOrigin-RevId: 509632450
2023-02-14 14:16:18 -08:00
MediaPipe TeamandCopybara-Service 9b1fe849d5 Fix incorrect comments in docs code sections
PiperOrigin-RevId: 509632192
2023-02-14 14:11:48 -08:00
MediaPipe TeamandCopybara-Service d9ac3876de Dos and Donts / Graph outputs + small adjustments for previous section (e.g removing "simply" word)
PiperOrigin-RevId: 509632077
2023-02-14 14:06:48 -08:00
MediaPipe TeamandCopybara-Service 5f2261ff59 face landmarks detector graph
PiperOrigin-RevId: 509630430
2023-02-14 14:00:37 -08:00
Copybara-Service d6fd2c52a7 Merge pull request #4093 from priankakariatyml:ios-ml-image-utils
PiperOrigin-RevId: 509602397
2023-02-14 12:17:41 -08:00
Sebastian SchmidtandCopybara-Service c2260e8877 Use mediapipe_proto_library for gl_context_options_proto
PiperOrigin-RevId: 509601125
2023-02-14 12:13:01 -08:00
MediaPipe TeamandCopybara-Service c66b7e83f0 ssd anchors calculator add fixed anchors.
PiperOrigin-RevId: 509574814
2023-02-14 10:43:23 -08:00
Prianka Liz Kariat 55e5377c08 Updated formatting 2023-02-14 20:51:51 +05:30
Prianka Liz Kariat 3a7aa29226 Updated note about packets callback in vision task runner 2023-02-14 20:49:14 +05:30
Prianka Liz Kariat 4e1fa82d50 Added designated initializer in vision task runner 2023-02-14 20:40:21 +05:30
Prianka Liz Kariat a490255c17 Updated formatting 2023-02-14 20:40:06 +05:30
Prianka Liz Kariat 17ff493a9d Updated formatting 2023-02-14 20:39:25 +05:30
Prianka Liz Kariat b940a19462 Merge branch 'master' into ios-ml-image-utils 2023-02-14 20:34:55 +05:30
Copybara-Service a578a702ec Merge pull request #4075 from priankakariatyml:ios-ml-image
PiperOrigin-RevId: 509465929
2023-02-14 02:19:35 -08:00
MediaPipe TeamandCopybara-Service ef9e5f881b Add Dos and Donts Section / Graph inputs
PiperOrigin-RevId: 509347658
2023-02-13 15:26:23 -08:00
MediaPipe TeamandCopybara-Service caa7d85141 Improves page-contents navigation: adds Uility Functions/Classes to page-contents)
PiperOrigin-RevId: 509347516
2023-02-13 15:22:13 -08:00
MediaPipe TeamandCopybara-Service 513ab7abba Internal change
PiperOrigin-RevId: 509338497
2023-02-13 14:47:34 -08:00
Sebastian SchmidtandCopybara-Service deae714a5c Enable Python Audio Classifier & Embedder on Windows
PiperOrigin-RevId: 509243198
2023-02-13 09:06:19 -08:00
Prianka Liz Kariat 1cd3c05fc5 Added default case to running mode check 2023-02-13 19:58:14 +05:30
Prianka Liz Kariat 328fe4ed39 Added vision task runner 2023-02-13 19:55:12 +05:30
Prianka Liz Kariat 1623b591b7 Added MPPRunningMode 2023-02-13 19:52:00 +05:30
Prianka Liz Kariat e2f1d07c8b Updated target definition for MPPImage 2023-02-13 19:44:09 +05:30
Prianka Liz Kariat 02734b3add Added MPPImageUtils 2023-02-13 19:43:49 +05:30
Prianka Liz Kariat acba3ab26d Bug fixes in MPPImage 2023-02-13 19:41:15 +05:30
Copybara-Service 5afa815bef Merge pull request #4050 from kuaashish:patch-3
PiperOrigin-RevId: 509190256
2023-02-13 04:34:51 -08:00
MediaPipe TeamandCopybara-Service 626f92caea Move BuildInputImageTensorSpecs to utils
PiperOrigin-RevId: 508829724
2023-02-10 21:57:13 -08:00
MediaPipe TeamandCopybara-Service 2c82f67097 Add location info in registry (debug mode only)
PiperOrigin-RevId: 508786558
2023-02-10 16:58:44 -08:00
MediaPipe TeamandCopybara-Service 23012f2151 Add Advanced Usage/Utility Classes section in Building Graph in C++
PiperOrigin-RevId: 508776246
2023-02-10 16:06:09 -08:00
MediaPipe TeamandCopybara-Service 482ee8f96c Add Capabilities/Utility Functions section in Building Graph in C++
PiperOrigin-RevId: 508773788
2023-02-10 15:54:23 -08:00
Hadon NashandCopybara-Service e719d2d423 Internal change
PiperOrigin-RevId: 508766449
2023-02-10 15:23:01 -08:00
Aden GrueandCopybara-Service 09ad961421 Internal change
PiperOrigin-RevId: 508701833
2023-02-10 10:54:55 -08:00
MediaPipe TeamandCopybara-Service 39a943e91e Request ModelResourcesGraphService for all Task API web graphs.
PiperOrigin-RevId: 508681004
2023-02-10 09:36:03 -08:00
MediaPipe TeamandCopybara-Service 915d2c7417 Internal text task change.
PiperOrigin-RevId: 508568811
2023-02-09 22:31:14 -08:00
MediaPipe TeamandCopybara-Service d61b7dbef8 Updated the Begin/EndLoopCalculator to be able to handle mediapipe::Tensor
type.

PiperOrigin-RevId: 508552066
2023-02-09 20:33:40 -08:00
MediaPipe TeamandCopybara-Service 8a49a5f822 This will fix the command to clone mediapipe in the macOS. Doc command mentioned
is throwing error when directly copied and pasted in the terminal.

PiperOrigin-RevId: 508550373
2023-02-09 20:23:58 -08:00
MediaPipe TeamandCopybara-Service 1eb54bdaa6 Internal change
PiperOrigin-RevId: 508533812
2023-02-09 18:49:01 -08:00
MediaPipe TeamandCopybara-Service 1f848c4d69 Fix typo in CalculatorGraph error message
PiperOrigin-RevId: 508517972
2023-02-09 17:29:33 -08:00
MediaPipe TeamandCopybara-Service be0681c61d Adds "Building Graphs in C++" initial page and updates "Graph" page to link to that section showcasing alternative C++ graph representation.
PiperOrigin-RevId: 508517348
2023-02-09 17:22:44 -08:00
MediaPipe TeamandCopybara-Service 2163920ee8 Minor updates to MediaPipe graph documentation: use Graph/CalculatorGraphConfig instead of GraphConfig and mention that node can be a subgraph.
PiperOrigin-RevId: 508517281
2023-02-09 17:21:30 -08:00
MediaPipe TeamandCopybara-Service fd764dae0a Depends on TFLite shim header.
PiperOrigin-RevId: 508491302
2023-02-09 15:29:47 -08:00
MediaPipe TeamandCopybara-Service 99fc975f49 Add download model on demand to text classifier
PiperOrigin-RevId: 508441452
2023-02-09 12:15:17 -08:00
MediaPipe TeamandCopybara-Service 28f728bed5 Change gesture_recognizer to download model files on-demand from GCS.
PiperOrigin-RevId: 508424508
2023-02-09 11:13:06 -08:00
MediaPipe TeamandCopybara-Service c3907229fe Use case: add metadata to headerless graph input audio streams.
PiperOrigin-RevId: 508389799
2023-02-09 09:07:02 -08:00
MediaPipe TeamandCopybara-Service 598d44a27d Internal change
PiperOrigin-RevId: 508284935
2023-02-08 23:31:41 -08:00
MediaPipe TeamandCopybara-Service 6ea2d579e1 Internal change
PiperOrigin-RevId: 508173086
2023-02-08 13:51:14 -08:00
Sebastian SchmidtandCopybara-Service 6c4ebd2d93 Pin version for com_google_audio_tools
PiperOrigin-RevId: 508158159
2023-02-08 12:53:39 -08:00
Rachel HornungandCopybara-Service 4b28ced8fd #MediaSequence Prevent undefined index access in metadata reconciliation.
Reconciliation required feature_lists.feature_list[0].value.feature[0].float_list.size_>=1, now we skip keys where size_=0.

PiperOrigin-RevId: 508095655
2023-02-08 09:06:02 -08:00
Prianka Liz Kariat 0e944cb764 Merged ios-ml-image with master 2023-02-08 21:43:39 +05:30
Prianka Liz Kariat e1ca81c352 Added objective c tests for MPPImage 2023-02-08 21:40:41 +05:30
Prianka Liz Kariat a82ffcd97c Updated mppimage target 2023-02-08 21:40:23 +05:30
Prianka Liz Kariat 445876d96b Updated formatting 2023-02-08 21:35:15 +05:30
Copybara-Service 19d895eb73 Merge pull request #4057 from kuaashish:master
PiperOrigin-RevId: 507869364
2023-02-07 13:29:56 -08:00
Copybara-Service fd6dfcfcab Merge pull request #4066 from priankakariatyml:ios-ml-image
PiperOrigin-RevId: 507844473
2023-02-07 11:52:37 -08:00
Sebastian SchmidtandCopybara-Service 712a22101f Do not use designated initializer
PiperOrigin-RevId: 507805920
2023-02-07 09:37:46 -08:00
Sebastian SchmidtandCopybara-Service e8caaeed61 Update WASM files for 0.1.0-alpha-4 release
PiperOrigin-RevId: 507792684
2023-02-07 08:46:15 -08:00
Prianka Liz Kariat be829eb276 Updated name of MPPTaskImage 2023-02-07 19:17:00 +05:30
Jiuqiang TangandCopybara-Service 01c6a8b49b Add volume_gain_db option into AudioToTensorCalculator.
PiperOrigin-RevId: 507748012
2023-02-07 05:14:42 -08:00
MediaPipe TeamandCopybara-Service 9b040630a3 Updating the Javascript API's FaceDetectionOptions since modelSelection is not a valid option for setOptions().
PiperOrigin-RevId: 507664805
2023-02-06 20:52:12 -08:00
Copybara-Service 28c07430ba Merge pull request #4052 from priankakariatyml:ios-text-embedder
PiperOrigin-RevId: 507602101
2023-02-06 15:42:48 -08:00
Chris McClanahanandCopybara-Service e2ef78433f Add more filtering methods to detection filter calculator.
PiperOrigin-RevId: 507581281
2023-02-06 14:19:40 -08:00
Jiuqiang TangandCopybara-Service f4b0cf1cff Internal change
PiperOrigin-RevId: 507540898
2023-02-06 11:48:51 -08:00
Sebastian SchmidtandCopybara-Service daf0a76c87 Update TensorFlow to latest
PiperOrigin-RevId: 507505016
2023-02-06 09:44:19 -08:00
MediaPipe TeamandCopybara-Service 5a77339780 Internal change
PiperOrigin-RevId: 507495569
2023-02-06 09:05:12 -08:00
Prianka Liz Kariat a3889c946d Updated list of designated initializers 2023-02-06 16:40:36 +05:30
Prianka Liz Kariat 0e4f0fbf9b Updated file name for MPPTaskImage 2023-02-06 16:39:17 +05:30
Prianka Liz Kariat 4da91896af Updated swift name for ImageSource Type 2023-02-06 16:36:33 +05:30
Prianka Liz Kariat a5ac5b9eec Updated type name of image source 2023-02-06 16:35:27 +05:30
Prianka Liz Kariat cbccd472ab Added MPPTaskImage for iOS vision tasks 2023-02-06 16:29:53 +05:30
MediaPipe TeamandCopybara-Service 4d8af4315f Rollback: Add PacketSharingOwnership, a safer replacement for PointToForeign.
PiperOrigin-RevId: 507288476
2023-02-05 08:59:09 -08:00
Jiuqiang TangandCopybara-Service 8e097ea9c3 Internal changes
PiperOrigin-RevId: 507016761
2023-02-03 16:07:42 -08:00
Sebastian SchmidtandCopybara-Service 680cfcc99b Update MP Tasks to observe timestamp bounds
PiperOrigin-RevId: 507006313
2023-02-03 15:21:41 -08:00
MediaPipe TeamandCopybara-Service 01834a5cdf Internal change
PiperOrigin-RevId: 506982474
2023-02-03 13:39:02 -08:00
Sebastian SchmidtandCopybara-Service 046efddf8b Add Empty Packet support to GraphRunner
PiperOrigin-RevId: 506963970
2023-02-03 12:17:00 -08:00
MediaPipe TeamandCopybara-Service 632a3602dd Internal text tasks change.
PiperOrigin-RevId: 506957718
2023-02-03 11:52:09 -08:00
MediaPipe TeamandCopybara-Service 386445c8dd Add ViewProvider<FrameBuffer> to YuvImage storage backend.
PiperOrigin-RevId: 506881556
2023-02-03 05:58:29 -08:00
kuaashishandGitHub e7dff428fa Delete 40-feature-request.md 2023-02-03 19:16:46 +05:30
kuaashishandGitHub 9b7081837c Delete 30-bug-issue.md 2023-02-03 19:16:35 +05:30
kuaashishandGitHub dd8d8ae422 Delete 20-documentation-issue.md 2023-02-03 19:16:26 +05:30
kuaashishandGitHub 4e47081d12 Delete 14-studio-issue.md 2023-02-03 19:16:16 +05:30
kuaashishandGitHub d3bd5db1f8 Delete 13-solution-issue.md 2023-02-03 19:16:01 +05:30
kuaashishandGitHub 1b535a4fd1 Delete 12-model-maker-issue.md 2023-02-03 19:15:52 +05:30
kuaashishandGitHub 51490ea5d9 Delete 11-tasks-issue.md 2023-02-03 19:15:44 +05:30
kuaashishandGitHub 2e8d615153 Rename model_maker_issue_template1.yaml to model_maker_issue_template.yaml 2023-02-03 19:07:59 +05:30
kuaashishandGitHub 77f3cd8942 Rename build.yaml to build.install_issue_template.yaml 2023-02-03 19:06:09 +05:30
kuaashishandGitHub b10812a7e2 Update Documentation_issue_template.yaml 2023-02-03 18:27:16 +05:30
kuaashishandGitHub 5046c2c5ce Update Documentation_issue_template.yaml 2023-02-03 18:26:53 +05:30
kuaashishandGitHub c0a360d8f4 Update Documentation_issue_template.yaml 2023-02-03 18:26:41 +05:30
kuaashishandGitHub 681136a1d8 Update Documentation_issue_template.yaml 2023-02-03 18:25:47 +05:30
kuaashishandGitHub 212b0279d0 Update Documentation_issue_template.yaml 2023-02-03 18:24:36 +05:30
kuaashishandGitHub 57b84d8ab3 Update Documentation_issue_template.yaml 2023-02-03 18:12:23 +05:30
kuaashishandGitHub 00592ac22d Update Documentation_issue_template.yaml 2023-02-03 18:11:55 +05:30
kuaashishandGitHub 423359b478 Update Documentation_issue_template.yaml 2023-02-03 18:10:47 +05:30
kuaashishandGitHub ba4b5160cd Update Documentation_issue_template.yaml 2023-02-03 18:10:18 +05:30
kuaashishandGitHub a2189c0143 Update Documentation_issue_template.yaml 2023-02-03 18:09:16 +05:30
kuaashishandGitHub c493c1a4ef Update Documentation_issue_template.yaml 2023-02-03 18:08:55 +05:30
kuaashishandGitHub 7661114a52 Update Documentation_issue_template.yaml 2023-02-03 18:07:39 +05:30
Prianka Liz Kariat eeaa011998 Updated documentation of iOS text embedder tests 2023-02-03 18:06:05 +05:30
Prianka Liz Kariat e290f9cf30 Added a note about swift test coverage in iOS text embedder tests 2023-02-03 18:05:49 +05:30
kuaashishandGitHub 1004fb48c7 Update Documentation_issue_template.yaml 2023-02-03 18:04:07 +05:30
kuaashishandGitHub acadf74f6c Update Documentation_issue_template.yaml 2023-02-03 18:03:32 +05:30
kuaashishandGitHub e93650f782 Update Documentation_issue_template.yaml 2023-02-03 18:03:17 +05:30
kuaashishandGitHub e5789396f3 Update Documentation_issue_template.yaml 2023-02-03 18:00:16 +05:30
kuaashishandGitHub 6688b12718 Update Documentation_issue_template.yaml 2023-02-03 17:59:39 +05:30
kuaashishandGitHub 9d55f14bf7 Update Documentation_issue_template.yaml 2023-02-03 17:59:28 +05:30
kuaashishandGitHub a6ad8b521f Update Documentation_issue_template.yaml 2023-02-03 17:57:28 +05:30
kuaashishandGitHub 8550dd86e5 Update Documentation_issue_template.yaml 2023-02-03 17:57:00 +05:30
kuaashishandGitHub ab11f852b0 Update Documentation_issue_template.yaml 2023-02-03 17:55:52 +05:30
kuaashishandGitHub 642922afcb Update Documentation_issue_template.yaml 2023-02-03 17:55:38 +05:30
kuaashishandGitHub 2ced054d81 Update Documentation_issue_template.yaml 2023-02-03 17:53:26 +05:30
kuaashishandGitHub eed7c954f8 Update Documentation_issue_template.yaml 2023-02-03 17:53:09 +05:30
kuaashishandGitHub b0ca0bce4f Update Documentation_issue_template.yaml 2023-02-03 17:51:04 +05:30
kuaashishandGitHub 61515655d1 Create Documentation_issue_template.yaml 2023-02-03 17:49:48 +05:30
kuaashishandGitHub 508a7cbfa5 Update feature_request_issue_template.yaml 2023-02-03 17:32:28 +05:30
kuaashishandGitHub eecfefbcb5 Update feature_request_issue_template.yaml 2023-02-03 17:32:17 +05:30
kuaashishandGitHub 5b595b5f30 Update feature_request_issue_template.yaml 2023-02-03 17:30:07 +05:30
kuaashishandGitHub 9ed873c93b Update feature_request_issue_template.yaml 2023-02-03 17:29:50 +05:30
kuaashishandGitHub fecb4f64fc Update feature_request_issue_template.yaml 2023-02-03 17:26:43 +05:30
kuaashishandGitHub 5c83bdde7a Delete feature_request_issue_template.yaml 2023-02-03 17:25:02 +05:30
kuaashishandGitHub 4071d149f2 Create feature_request_issue_template.yaml 2023-02-03 17:24:28 +05:30
kuaashishandGitHub e055fdb62b Create feature_request_issue_template.yaml 2023-02-03 17:22:34 +05:30
kuaashishandGitHub b129978f89 Update bug_issue_template.yaml 2023-02-03 17:09:24 +05:30
kuaashishandGitHub e29a54221a Update bug_issue_template.yaml 2023-02-03 17:09:14 +05:30
kuaashishandGitHub 810cef8dac Create bug_issue_template.yaml 2023-02-03 17:08:29 +05:30
kuaashishandGitHub 388c746839 Update studio_issue_template.yaml 2023-02-03 16:48:50 +05:30
kuaashishandGitHub 3a10b7c44b Update studio_issue_template.yaml 2023-02-03 16:48:30 +05:30
kuaashishandGitHub c851c6e5dc Update studio_issue_template.yaml 2023-02-03 16:46:13 +05:30
kuaashishandGitHub 0de0035420 Update studio_issue_template.yaml 2023-02-03 16:43:14 +05:30
kuaashishandGitHub 147890fc33 Create studio_issue_template.yaml 2023-02-03 16:42:58 +05:30
kuaashishandGitHub 22e05fc16a Update and rename Solution(Legacy_issue_template.yaml to Solution(Legacy_issue_template).yaml 2023-02-03 16:35:23 +05:30
kuaashishandGitHub 23cf1ee8c3 Create Solution(Legacy_issue_template.yaml 2023-02-03 16:32:03 +05:30
kuaashishandGitHub 14d51d28af Update task_issue_template.yaml 2023-02-03 16:18:54 +05:30
kuaashishandGitHub f197652c3a Create task_issue_template.yaml 2023-02-03 16:16:25 +05:30
kuaashishandGitHub e5a6d3ec3b Update model_maker_issue_template1.yaml 2023-02-03 16:05:33 +05:30
kuaashishandGitHub 4139ce76e0 Update model_maker_issue_template1.yaml 2023-02-03 16:03:01 +05:30
kuaashishandGitHub ca6e4cb7a5 Update model_maker_issue_template1.yaml 2023-02-03 16:01:56 +05:30
kuaashishandGitHub 434c1143ae Update and rename model_maker_issue_template.yaml to model_maker_issue_template1.yaml 2023-02-03 16:01:18 +05:30
kuaashishandGitHub 93ef2f69fb Update model_maker_issue_template.yaml 2023-02-03 16:00:21 +05:30
kuaashishandGitHub d01901f156 Update model_maker_issue_template.yaml 2023-02-03 15:59:15 +05:30
kuaashishandGitHub 79b747969e Update model_maker_issue_template.yaml 2023-02-03 15:58:48 +05:30
kuaashishandGitHub 9de43a83f6 Update model_maker_issue_template.yaml 2023-02-03 15:53:24 +05:30
kuaashishandGitHub 8c60e412b2 Update model_maker_issue_template.yaml 2023-02-03 15:51:37 +05:30
kuaashishandGitHub 96936cf6b2 Update model_maker_issue_template.yaml 2023-02-03 15:50:00 +05:30
kuaashishandGitHub d0486ec9fd Update model_maker_issue_template.yaml 2023-02-03 15:48:18 +05:30
kuaashishandGitHub 79e39e6d52 Update model_maker_issue_template.yaml 2023-02-03 15:47:37 +05:30
kuaashishandGitHub dd10c54ed5 Create model_maker_issue_template.yaml 2023-02-03 15:45:51 +05:30
kuaashishandGitHub 182dfeb4e9 Update build.yaml 2023-02-03 15:25:44 +05:30
kuaashishandGitHub 4ca9b2d43a Update build.yaml 2023-02-03 15:25:23 +05:30
kuaashishandGitHub eea62dca15 Update build.yaml 2023-02-03 15:24:47 +05:30
kuaashishandGitHub 0f7743db1b Update build.yaml 2023-02-03 15:07:33 +05:30
kuaashishandGitHub 2c84077859 Update build.yaml 2023-02-03 15:02:07 +05:30
kuaashishandGitHub 1b0923c3d7 Delete 00-build-installation-issue.md 2023-02-03 14:59:10 +05:30
kuaashishandGitHub d97df4071e Merge branch 'google:master' into master 2023-02-03 14:58:34 +05:30
kuaashishandGitHub f7b035b15e Update build.yaml 2023-02-03 14:57:28 +05:30
kuaashishandGitHub be42a73f43 Update build.yaml 2023-02-03 14:56:44 +05:30
kuaashishandGitHub 6a90f8b27e Update build.yaml 2023-02-03 14:55:36 +05:30
kuaashishandGitHub d554f92d71 Update build.yaml 2023-02-03 14:53:50 +05:30
kuaashishandGitHub 78502bb5fd Update build.yaml 2023-02-03 14:49:37 +05:30
kuaashishandGitHub daa2116773 Update build.yaml 2023-02-03 14:48:52 +05:30
kuaashishandGitHub 43a97637db Update build.yaml 2023-02-03 14:47:37 +05:30
kuaashishandGitHub 598624d201 Update build.yaml 2023-02-03 14:43:29 +05:30
kuaashishandGitHub b75c7dedfc Update build.yaml 2023-02-03 14:41:13 +05:30
kuaashishandGitHub 01a740db5f Update build.yaml 2023-02-03 14:36:16 +05:30
kuaashishandGitHub 76685b2213 Update build.yaml 2023-02-03 14:35:05 +05:30
kuaashishandGitHub a235621b16 Update build.yaml 2023-02-03 14:34:41 +05:30
kuaashishandGitHub 90c5dc19d1 Update build.yaml 2023-02-03 14:33:47 +05:30
kuaashishandGitHub 9af30f98a2 Create build.yaml 2023-02-03 14:32:38 +05:30
Prianka Liz Kariat 3b55fb9f6a Added iOS test for quantized embedding 2023-02-03 13:42:32 +05:30
Prianka Liz Kariat b5b10e7681 Added iOS test for different themes in text embedder 2023-02-03 13:10:13 +05:30
Prianka Liz Kariat a512e6b5f5 Updated MPPTextEmbedder Documentation 2023-02-03 12:49:00 +05:30
Prianka Liz Kariat 6ca1efdd55 Updated MPPTextEmbedder Documentation 2023-02-03 12:48:06 +05:30
kuaashishandGitHub 1a26071a41 Update install.md
This will fix the Subsystem typo in line 654
2023-02-03 12:12:45 +05:30
MediaPipe TeamandCopybara-Service e485961c2d fixes spelling mistake
PiperOrigin-RevId: 506697863
2023-02-02 12:49:30 -08:00
Prianka Liz Kariat 20002f191a Changed documentation 2023-02-02 18:38:19 +05:30
Prianka Liz Kariat d625918995 Added swift tests for text embedder 2023-02-02 18:36:55 +05:30
Prianka Liz Kariat 474e994a5f Added text embedder objective c tests 2023-02-02 17:30:05 +05:30
Prianka Liz Kariat 867520af1c Added cosine similarity to MPPTextEmbedder 2023-02-02 17:29:51 +05:30
Prianka Liz Kariat 84e1c93ffb Added MPPCosineSimilarity 2023-02-02 17:22:56 +05:30
kuaashishandGitHub c79350da5f Update javascript.md
This will fix the typo from "Supported plaforms" to "Supported platforms" in line 32
2023-02-02 17:12:09 +05:30
Sebastian SchmidtandCopybara-Service 286dde97ad Make TextEmbedder and TextClassifier tests pass on Windows
PiperOrigin-RevId: 506421383
2023-02-01 14:22:04 -08:00
Copybara-Service bdd77b0d61 Merge pull request #4048 from priankakariatyml:ios-text-embedder
PiperOrigin-RevId: 506407904
2023-02-01 13:32:58 -08:00
Sebastian SchmidtandCopybara-Service 0f3cf9c56a Add "noasan" to MPPTextClassifierObjcTest
PiperOrigin-RevId: 506366650
2023-02-01 11:06:17 -08:00
Sebastian SchmidtandCopybara-Service 83e33b4dbe Internal change
PiperOrigin-RevId: 506345436
2023-02-01 09:55:19 -08:00
Juhyun LeeandCopybara-Service 0919a6c0a3 Log which InferenceCalculator impl is used at runtime.
PiperOrigin-RevId: 506343086
2023-02-01 09:45:36 -08:00
MediaPipe TeamandCopybara-Service 3ee377f671 Internal change
PiperOrigin-RevId: 506312863
2023-02-01 07:42:20 -08:00
Prianka Liz Kariat bd507b2d7b Updated MPPEmbeddingHelpers to reflect type change of quantized embeddings 2023-02-01 19:27:05 +05:30
Prianka Liz Kariat cd1cb87ff6 Merge branch 'master' into ios-text-embedder 2023-02-01 19:11:01 +05:30
Prianka Liz Kariat 85c310d01c Updated formatting 2023-02-01 18:52:55 +05:30
Prianka Liz Kariat d588f73a6d Added MPPTextEmbedder 2023-02-01 18:51:30 +05:30
Prianka Liz Kariat 38eac174e9 Added MPPTextEmbedderResultHelpers 2023-02-01 18:51:01 +05:30
Prianka Liz Kariat 42e712e911 Added MPPTextEmbedderOptionsHelpers 2023-02-01 18:50:14 +05:30
Prianka Liz Kariat 69809e2181 Updated formatting 2023-02-01 18:48:10 +05:30
Prianka Liz Kariat ffc9f1d47e Added MPPEmbeddingResultHelpers 2023-02-01 18:47:23 +05:30
Prianka Liz Kariat 24bd104b0f Added MPPEmbedding Helpers 2023-02-01 18:46:11 +05:30
MediaPipe TeamandCopybara-Service d283e6a05a Support downloading model files on-demand from GCS in model_maker
PiperOrigin-RevId: 506174708
2023-01-31 18:43:35 -08:00
MediaPipe TeamandCopybara-Service b53acf6267 Internal change
PiperOrigin-RevId: 506059384
2023-01-31 11:20:13 -08:00
MediaPipe TeamandCopybara-Service 5730dec260 Internal change
PiperOrigin-RevId: 506053206
2023-01-31 11:03:41 -08:00
Copybara-Service 0863a8a1e7 Merge pull request #4030 from priankakariatyml:ios-text-embedder
PiperOrigin-RevId: 506048365
2023-01-31 10:47:19 -08:00
MediaPipe TeamandCopybara-Service 591eb204a6 Internal change
PiperOrigin-RevId: 506027661
2023-01-31 09:36:56 -08:00
Sebastian SchmidtandCopybara-Service be3bddc620 Add Text Embedder tests for text with different themes
PiperOrigin-RevId: 506023265
2023-01-31 09:23:30 -08:00
Jiuqiang TangandCopybara-Service 2c4dece023 Internal change
PiperOrigin-RevId: 505723714
2023-01-30 10:00:22 -08:00
MediaPipe TeamandCopybara-Service f9f6acffed Make NORM_RECT optional for GestureRecognizerGraph and add PALM_DETECTION output PORT
PiperOrigin-RevId: 505712542
2023-01-30 09:17:38 -08:00
Prianka Liz Kariat 8c21dc02a6 Updated to types of float and quantized embedding 2023-01-30 11:42:33 +05:30
MediaPipe TeamandCopybara-Service ee2f940e1f Make TensorToVectorFloatCalculator compatible with unaligned tensors.
No performance impact is expected, since the unaligned Eigen::TensorMap is used only to populate a std::vector<float>.

PiperOrigin-RevId: 505251810
2023-01-27 18:08:03 -08:00
Sebastian SchmidtandCopybara-Service 702cc0c42c Change documentation to use shallow clones of the MP Repo
PiperOrigin-RevId: 505234066
2023-01-27 16:21:34 -08:00
Sebastian SchmidtandCopybara-Service dc3fdf6eb4 Internal change
PiperOrigin-RevId: 505193224
2023-01-27 13:16:06 -08:00
MediaPipe TeamandCopybara-Service a6f6be9512 Fix incorrect uint8 -> int8 conversion in JS cosine similarity.
PiperOrigin-RevId: 505135368
2023-01-27 09:21:58 -08:00
MediaPipe TeamandCopybara-Service 1df4511e9d Add YuvImage as a GpuBuffer storage backend.
PiperOrigin-RevId: 505128789
2023-01-27 08:51:31 -08:00
MediaPipe TeamandCopybara-Service e059d55d29 Correctly check refCount in finalize.
PiperOrigin-RevId: 505057866
2023-01-27 01:52:48 -08:00
Prianka Liz Kariat 8531803462 Updated documentation of embedding containers 2023-01-27 11:08:39 +05:30
Sebastian SchmidtandCopybara-Service c29ab7f083 Internal change
PiperOrigin-RevId: 504928797
2023-01-26 13:36:45 -08:00
Sebastian SchmidtandCopybara-Service 4d38557f11 Add MediaPipe Image Segmenter task for Web
PiperOrigin-RevId: 504912518
2023-01-26 12:31:54 -08:00
MediaPipe TeamandCopybara-Service 29001234d5 Replace SourceOrNodeOutput with Source.
PiperOrigin-RevId: 504883990
2023-01-26 10:46:12 -08:00
MediaPipe TeamandCopybara-Service 2547f07c77 Add FrameBuffer format.
PiperOrigin-RevId: 504838580
2023-01-26 07:40:52 -08:00
Jiuqiang TangandCopybara-Service 0566e0e7ca Fix the output stream tag of the end loop calculator in the example code.
PiperOrigin-RevId: 504708273
2023-01-25 17:52:55 -08:00
MediaPipe TeamandCopybara-Service be546d22fc Update test to reflect the recommended graph construction style:
First, graph inputs and their names:
  - Makes it clear what inputs graph has
  - Indirectly demands for type specification e.g. Stream<AnyType> a = graph.In(0); vs Stream<int> a = graph.In(0).Cast<int>();
Then graph nodes
  - Nodes are added and used as they needed
  - One node is not mixed in other nodes, only its outputs
  - Indirectly demands for type specification e.g. Stream<AnyType> a = node.Out(0); vs Stream<int> a = node.Out(0).Cast<int>();
Then graph outputs
  - Makes it clear what outputs graph has

The recommended structure keep C++ graph similar to pbtxt representation.

PiperOrigin-RevId: 504701023
2023-01-25 17:13:17 -08:00
MediaPipe TeamandCopybara-Service ff0ccfc209 Internal change
PiperOrigin-RevId: 504677663
2023-01-25 15:31:21 -08:00
Sebastian SchmidtandCopybara-Service 1538740dcb Formatting fix
PiperOrigin-RevId: 504599712
2023-01-25 10:33:09 -08:00
Prianka Liz Kariat 61f7739ff6 Updated documentation 2023-01-25 20:20:22 +05:30
Prianka Liz Kariat d01f75a295 Added iOS text embedder result files 2023-01-25 20:19:57 +05:30
Prianka Liz Kariat 168ea0a9ea Added MPPTextEmbedderResult 2023-01-25 20:19:40 +05:30
Prianka Liz Kariat 60e72bf165 Added MPPTextEmbedderOptions 2023-01-25 20:19:27 +05:30
Prianka Liz Kariat db5ee6689f Added MPPEmbeddingResult 2023-01-25 20:17:04 +05:30
Prianka Liz Kariat 7d62402768 Added MPPEmbedding 2023-01-25 20:16:54 +05:30
MediaPipe TeamandCopybara-Service afb0182935 Internal model maker change.
PiperOrigin-RevId: 504472342
2023-01-24 23:16:21 -08:00
Sebastian SchmidtandCopybara-Service 5dc81c4c27 Remove unused import on strings.h
PiperOrigin-RevId: 504397437
2023-01-24 15:56:15 -08:00
Yuqi LiandCopybara-Service 679dbb3fd8 nit: update the metadata_schema.fbs file path.
PiperOrigin-RevId: 504380873
2023-01-24 14:46:25 -08:00
Kinar RandGitHub 2dc790dbd9 Merge branch 'google:master' into cosine-sim-python 2023-01-25 00:25:23 +05:30
kinaryml ea77a7c25d Undo commenting out remaining tests 2022-11-17 14:06:30 -08:00
kinaryml 87238705dd Updated cosine similarity utility 2022-11-17 14:03:07 -08:00
1124 changed files with 99739 additions and 6240 deletions
+1 -1
View File
@@ -1 +1 @@
5.2.0
6.1.1
@@ -1,27 +0,0 @@
---
name: "Build/Installation Issue"
about: Use this template for build/installation issues
labels: type:build/install
---
<em>Please make sure that this is a build/installation issue and also refer to the [troubleshooting](https://google.github.io/mediapipe/getting_started/troubleshooting.html) documentation before raising any issues.</em>
**System information** (Please provide as much relevant information as possible)
- OS Platform and Distribution (e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4):
- Compiler version (e.g. gcc/g++ 8 /Apple clang version 12.0.0):
- Programming Language and version ( e.g. C++ 14, Python 3.6, Java ):
- Installed using virtualenv? pip? Conda? (if python):
- [MediaPipe version](https://github.com/google/mediapipe/releases):
- Bazel version:
- XCode and Tulsi versions (if iOS):
- Android SDK and NDK versions (if android):
- Android [AAR](https://google.github.io/mediapipe/getting_started/android_archive_library.html) ( if android):
- OpenCV version (if running on desktop):
**Describe the problem**:
**[Provide the exact sequence of commands / steps that you executed before running into the problem](https://google.github.io/mediapipe/getting_started/getting_started.html):**
**Complete Logs:**
Include Complete Log information or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached:
-25
View File
@@ -1,25 +0,0 @@
---
name: "Tasks Issue"
about: Use this template for assistance with using MediaPipe Tasks (developers.google.com/mediapipe/solutions) to deploy on-device ML solutions (e.g. gesture recognition etc.) on supported platforms.
labels: type:support
---
<em>Please make sure that this is a [Tasks](https://developers.google.com/mediapipe/solutions) issue.<em>
**System information** (Please provide as much relevant information as possible)
- Have I written custom code (as opposed to using a stock example script provided in MediaPipe):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4):
- MediaPipe Tasks SDK version:
- Task name (e.g. Object detection, Gesture recognition etc.):
- Programming Language and version ( e.g. C++, Python, Java):
**Describe the expected behavior:**
**Standalone code you may have used to try to get what you need :**
If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem:
**Other info / Complete Logs :**
Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached:
@@ -1,25 +0,0 @@
---
name: "Model Maker Issue"
about: Use this template for assistance with using MediaPipe Model Maker (developers.google.com/mediapipe/solutions) to create custom on-device ML solutions.
labels: type:support
---
<em>Please make sure that this is a [Model Maker](https://developers.google.com/mediapipe/solutions) issue.<em>
**System information** (Please provide as much relevant information as possible)
- Have I written custom code (as opposed to using a stock example script provided in MediaPipe):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Python version (e.g. 3.8):
- [MediaPipe Model Maker version](https://pypi.org/project/mediapipe-model-maker/):
- Task name (e.g. Image classification, Gesture recognition etc.):
**Describe the expected behavior:**
**Standalone code you may have used to try to get what you need :**
If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem:
**Other info / Complete Logs :**
Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached:
@@ -1,26 +0,0 @@
---
name: "Solution (legacy) Issue"
about: Use this template for assistance with a specific Mediapipe solution (google.github.io/mediapipe/solutions) such as "Pose", including inference model usage/training, solution-specific calculators etc.
labels: type:support
---
<em>Please make sure that this is a [solution](https://google.github.io/mediapipe/solutions/solutions.html) issue.<em>
**System information** (Please provide as much relevant information as possible)
- Have I written custom code (as opposed to using a stock example script provided in Mediapipe):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4):
- [MediaPipe version](https://github.com/google/mediapipe/releases):
- Bazel version:
- Solution (e.g. FaceMesh, Pose, Holistic):
- Programming Language and version ( e.g. C++, Python, Java):
**Describe the expected behavior:**
**Standalone code you may have used to try to get what you need :**
If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/repo link /any notebook:
**Other info / Complete Logs :**
Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached:
-19
View File
@@ -1,19 +0,0 @@
---
name: "Studio Issue"
about: Use this template for assistance with the MediaPipe Studio application.
labels: type:support
---
<em>Please make sure that this is a MediaPipe Studio issue.<em>
**System information** (Please provide as much relevant information as possible)
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4):
- Browser and Version
- Any microphone or camera hardware
- URL that shows the problem
**Describe the expected behavior:**
**Other info / Complete Logs :**
Include any js console logs that would be helpful to diagnose the problem.
Large logs and files should be attached:
@@ -1,51 +0,0 @@
---
name: "Documentation Issue"
about: Use this template for documentation related issues
labels: type:docs
---
Thank you for submitting a MediaPipe documentation issue.
The MediaPipe docs are open source! To get involved, read the documentation Contributor Guide
## URL(s) with the issue:
Please provide a link to the documentation entry, for example: https://github.com/google/mediapipe/blob/master/docs/solutions/face_mesh.md#models
## Description of issue (what needs changing):
Kinds of documentation problems:
### Clear description
For example, why should someone use this method? How is it useful?
### Correct links
Is the link to the source code correct?
### Parameters defined
Are all parameters defined and formatted correctly?
### Returns defined
Are return values defined?
### Raises listed and defined
Are the errors defined? For example,
### Usage example
Is there a usage example?
See the API guide:
on how to write testable usage examples.
### Request visuals, if applicable
Are there currently visuals? If not, will it clarify the content?
### Submit a pull request?
Are you planning to also submit a pull request to fix the issue? See the docs
https://github.com/google/mediapipe/blob/master/CONTRIBUTING.md
-32
View File
@@ -1,32 +0,0 @@
---
name: "Bug Issue"
about: Use this template for reporting a bug
labels: type:bug
---
<em>Please make sure that this is a bug and also refer to the [troubleshooting](https://google.github.io/mediapipe/getting_started/troubleshooting.html), FAQ documentation before raising any issues.</em>
**System information** (Please provide as much relevant information as possible)
- Have I written custom code (as opposed to using a stock example script provided in MediaPipe):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4):
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- Browser and version (e.g. Google Chrome, Safari) if the issue happens on browser:
- Programming Language and version ( e.g. C++, Python, Java):
- [MediaPipe version](https://github.com/google/mediapipe/releases):
- Bazel version (if compiling from source):
- Solution ( e.g. FaceMesh, Pose, Holistic ):
- Android Studio, NDK, SDK versions (if issue is related to building in Android environment):
- Xcode & Tulsi version (if issue is related to building for iOS):
**Describe the current behavior:**
**Describe the expected behavior:**
**Standalone code to reproduce the issue:**
Provide a reproducible test case that is the bare minimum necessary to replicate the problem. If possible, please share a link to Colab/repo link /any notebook:
**Other info / Complete Logs :**
Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached
@@ -1,24 +0,0 @@
---
name: "Feature Request"
about: Use this template for raising a feature request
labels: type:feature
---
<em>Please make sure that this is a feature request.</em>
**System information** (Please provide as much relevant information as possible)
- MediaPipe Solution (you are using):
- Programming language : C++/typescript/Python/Objective C/Android Java
- Are you willing to contribute it (Yes/No):
**Describe the feature and the current behavior/state:**
**Will this change the current api? How?**
**Who will benefit with this feature?**
**Please specify the use cases for this feature:**
**Any Other info:**
@@ -0,0 +1,73 @@
name: Documentation issue
description: Use this template for documentation related issues. If this doesnt look right, choose a different type.
labels: 'type:doc-bug'
body:
- type: markdown
id: link
attributes:
value: Thank you for submitting a MediaPipe documentation issue. The MediaPipe docs are open source! To get involved, read the documentation Contributor Guide
- type: markdown
id: url
attributes:
value: URL(s) with the issue Please provide a link to the documentation entry, for example https://github.com/google/mediapipe/blob/master/docs/solutions/face_mesh.md#models
- type: input
id: description
attributes:
label: Description of issue (what needs changing)
description: Kinds of documentation problems
- type: input
id: clear_desc
attributes:
label: Clear description
description: For example, why should someone use this method? How is it useful?
validations:
required: true
- type: input
id: link
attributes:
label: Correct links
description: Is the link to the source code correct?
validations:
required: false
- type: input
id: parameter
attributes:
label: Parameters defined
description: Are all parameters defined and formatted correctly?
validations:
required: false
- type: input
id: returns
attributes:
label: Returns defined
description: Are return values defined?
validations:
required: false
- type: input
id: raises
attributes:
label: Raises listed and defined
description: Are the errors defined? For example,
validations:
required: false
- type: input
id: usage
attributes:
label: Usage example
description: Is there a usage example? See the API guide-on how to write testable usage examples.
validations:
required: false
- type: input
id: visual
attributes:
label: Request visuals, if applicable
description: Are there currently visuals? If not, will it clarify the content?
validations:
required: false
- type: input
id: pull
attributes:
label: Submit a pull request?
description: Are you planning to also submit a pull request to fix the issue? See the [docs](https://github.com/google/mediapipe/blob/master/CONTRIBUTING.md)
validations:
required: false
@@ -0,0 +1,80 @@
name: Solution(Legacy) Issue
description: Use this template for assistance with a specific Mediapipe solution (google.github.io/mediapipe/solutions) such as "Pose", including inference model usage/training, solution-specific calculators etc.
labels: 'type:support'
body:
- type: markdown
id: linkmodel
attributes:
value: Please make sure that this is a [solution](https://google.github.io/mediapipe/solutions/solutions.html) issue.
- type: dropdown
id: customcode_model
attributes:
label: Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
options:
- 'Yes'
- 'No'
validations:
required: false
- type: input
id: os_model
attributes:
label: OS Platform and Distribution
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: false
- type: input
id: mediapipe_version
attributes:
label: MediaPipe version
validations:
required: false
- type: input
id: bazel_version
attributes:
label: Bazel version
validations:
required: false
- type: input
id: solution
attributes:
label: Solution
placeholder: e.g. FaceMesh, Pose, Holistic
validations:
required: false
- type: input
id: programminglang
attributes:
label: Programming Language and version
placeholder: e.g. C++, Python, Java
validations:
required: false
- type: textarea
id: current_model
attributes:
label: Describe the actual behavior
render: shell
validations:
required: false
- type: textarea
id: expected_model
attributes:
label: Describe the expected behaviour
render: shell
validations:
required: false
- type: textarea
id: what-happened_model
attributes:
label: Standalone code/steps you may have used to try to get what you need
description: If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem
render: shell
validations:
required: false
- type: textarea
id: other_info
attributes:
label: Other info / Complete Logs
description: Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
render: shell
validations:
required: false
@@ -0,0 +1,112 @@
name: Bug Issues
description: Use this template for reporting a bug. If this doesnt look right, choose a different type.
labels: 'type:bug'
body:
- type: markdown
id: link
attributes:
value: Please make sure that this is a bug and also refer to the [troubleshooting](https://google.github.io/mediapipe/getting_started/troubleshooting.html), FAQ documentation before raising any issues.
- type: dropdown
id: customcode_model
attributes:
label: Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
options:
- 'Yes'
- 'No'
validations:
required: false
- type: input
id: os
attributes:
label: OS Platform and Distribution
description:
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: true
- type: input
id: mobile_device
attributes:
label: Mobile device if the issue happens on mobile device
description:
placeholder: e.g. iPhone 8, Pixel 2, Samsung Galaxy
validations:
required: false
- type: input
id: browser_version
attributes:
label: Browser and version if the issue happens on browser
placeholder: e.g. Google Chrome 109.0.5414.119, Safari 16.3
validations:
required: false
- type: input
id: programminglang
attributes:
label: Programming Language and version
placeholder: e.g. C++, Python, Java
validations:
required: true
- type: input
id: mediapipever
attributes:
label: MediaPipe version
description:
placeholder: e.g. 0.8.11, 0.9.1
validations:
required: false
- type: input
id: bazelver
attributes:
label: Bazel version
description:
placeholder: e.g. 5.0, 5.1
validations:
required: false
- type: input
id: solution
attributes:
label: Solution
placeholder: e.g. FaceMesh, Pose, Holistic
validations:
required: true
- type: input
id: sdkndkversion
attributes:
label: Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
validations:
required: false
- type: input
id: xcode_ver
attributes:
label: Xcode & Tulsi version (if issue is related to building for iOS)
validations:
required: false
- type: textarea
id: current_model
attributes:
label: Describe the actual behavior
render: shell
validations:
required: true
- type: textarea
id: expected_model
attributes:
label: Describe the expected behaviour
render: shell
validations:
required: true
- type: textarea
id: what-happened_model
attributes:
label: Standalone code/steps you may have used to try to get what you need
description: If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem
render: shell
validations:
required: true
- type: textarea
id: other_info
attributes:
label: Other info / Complete Logs
description: Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
render: shell
validations:
required: false
@@ -0,0 +1,109 @@
name: Build/Install Issue
description: Use this template to report build/install issue
labels: 'type:build/install'
body:
- type: markdown
id: link
attributes:
value: Please make sure that this is a build/installation issue and also refer to the [troubleshooting](https://google.github.io/mediapipe/getting_started/troubleshooting.html) documentation before raising any issues.
- type: input
id: os
attributes:
label: OS Platform and Distribution
description:
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: true
- type: input
id: compilerversion
attributes:
label: Compiler version
description:
placeholder: e.g. gcc/g++ 8 /Apple clang version 12.0.0
validations:
required: false
- type: input
id: programminglang
attributes:
label: Programming Language and version
description:
placeholder: e.g. C++ 14, Python 3.6, Java
validations:
required: true
- type: input
id: virtualenv
attributes:
label: Installed using virtualenv? pip? Conda?(if python)
description:
placeholder:
validations:
required: false
- type: input
id: mediapipever
attributes:
label: MediaPipe version
description:
placeholder: e.g. 0.8.11, 0.9.1
validations:
required: false
- type: input
id: bazelver
attributes:
label: Bazel version
description:
placeholder: e.g. 5.0, 5.1
validations:
required: false
- type: input
id: xcodeversion
attributes:
label: XCode and Tulsi versions (if iOS)
description:
placeholder:
validations:
required: false
- type: input
id: sdkndkversion
attributes:
label: Android SDK and NDK versions (if android)
description:
placeholder:
validations:
required: false
- type: dropdown
id: androidaar
attributes:
label: Android AAR (if android)
options:
- 'Yes'
- 'No'
validations:
required: false
- type: input
id: opencvversion
attributes:
label: OpenCV version (if running on desktop)
description:
placeholder:
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: Describe the problem
description: Provide the exact sequence of commands / steps that you executed before running into the [problem](https://google.github.io/mediapipe/getting_started/getting_started.html)
placeholder: Tell us what you see!
value: "A bug happened!"
render: shell
validations:
required: true
- type: textarea
id: code-to-reproduce
attributes:
label: Complete Logs
description: Include Complete Log information or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
placeholder: Tell us what you see!
value:
render: shell
validations:
required: true
@@ -0,0 +1,64 @@
name: Feature Request Issues
description: Use this template for raising a feature request. If this doesnt look right, choose a different type.
labels: 'type:feature'
body:
- type: markdown
id: linkmodel
attributes:
value: Please make sure that this is a feature request.
- type: input
id: solution
attributes:
label: MediaPipe Solution (you are using)
validations:
required: false
- type: input
id: pgmlang
attributes:
label: Programming language
placeholder: C++/typescript/Python/Objective C/Android Java
validations:
required: false
- type: dropdown
id: willingcon
attributes:
label: Are you willing to contribute it
options:
- 'Yes'
- 'No'
validations:
required: false
- type: textarea
id: behaviour
attributes:
label: Describe the feature and the current behaviour/state
render: shell
validations:
required: true
- type: textarea
id: api_change
attributes:
label: Will this change the current API? How?
render: shell
validations:
required: false
- type: textarea
id: benifit
attributes:
label: Who will benefit with this feature?
validations:
required: false
- type: textarea
id: use_case
attributes:
label: Please specify the use cases for this feature
render: shell
validations:
required: true
- type: textarea
id: info_other
attributes:
label: Any Other info
render: shell
validations:
required: false
@@ -0,0 +1,73 @@
name: Model Maker Issues
description: Use this template for assistance with using MediaPipe Model Maker (developers.google.com/mediapipe/solutions) to create custom on-device ML solutions.
labels: 'type:modelmaker'
body:
- type: markdown
id: linkmodel
attributes:
value: Please make sure that this is a [Model Maker](https://developers.google.com/mediapipe/solutions) issue
- type: dropdown
id: customcode_model
attributes:
label: Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
options:
- 'Yes'
- 'No'
validations:
required: false
- type: input
id: os_model
attributes:
label: OS Platform and Distribution
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: true
- type: input
id: pythonver
attributes:
label: Python Version
placeholder: e.g. 3.7, 3.8
validations:
required: true
- type: input
id: modelmakerver
attributes:
label: MediaPipe Model Maker version
validations:
required: false
- type: input
id: taskname
attributes:
label: Task name (e.g. Image classification, Gesture recognition etc.)
validations:
required: true
- type: textarea
id: current_model
attributes:
label: Describe the actual behavior
render: shell
validations:
required: true
- type: textarea
id: expected_model
attributes:
label: Describe the expected behaviour
render: shell
validations:
required: true
- type: textarea
id: what-happened_model
attributes:
label: Standalone code/steps you may have used to try to get what you need
description: If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem
render: shell
validations:
required: true
- type: textarea
id: other_info
attributes:
label: Other info / Complete Logs
description: Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
render: shell
validations:
required: false
@@ -0,0 +1,63 @@
name: Studio Issues
description: Use this template for assistance with the MediaPipe Studio application. If this doesnt look right, choose a different type.
labels: 'type:support'
body:
- type: markdown
id: linkmodel
attributes:
value: Please make sure that this is a MediaPipe Studio issue.
- type: input
id: os_model
attributes:
label: OS Platform and Distribution
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: false
- type: input
id: browserver
attributes:
label: Browser and Version
validations:
required: false
- type: input
id: hardware
attributes:
label: Any microphone or camera hardware
validations:
required: false
- type: input
id: url
attributes:
label: URL that shows the problem
validations:
required: false
- type: textarea
id: current_model
attributes:
label: Describe the actual behavior
render: shell
validations:
required: false
- type: textarea
id: expected_model
attributes:
label: Describe the expected behaviour
render: shell
validations:
required: false
- type: textarea
id: what-happened_model
attributes:
label: Standalone code/steps you may have used to try to get what you need
description: If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem
render: shell
validations:
required: false
- type: textarea
id: other_info
attributes:
label: Other info / Complete Logs
description: Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
render: shell
validations:
required: false
@@ -0,0 +1,72 @@
name: Task Issue
description: Use this template for assistance with using MediaPipe Tasks (developers.google.com/mediapipe/solutions) to deploy on-device ML solutions (e.g. gesture recognition etc.) on supported platforms
labels: 'type:task'
body:
- type: markdown
id: linkmodel
attributes:
value: Please make sure that this is a [Tasks](https://developers.google.com/mediapipe/solutions) issue.
- type: dropdown
id: customcode_model
attributes:
label: Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
options:
- 'Yes'
- 'No'
validations:
required: false
- type: input
id: os_model
attributes:
label: OS Platform and Distribution
placeholder: e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4
validations:
required: true
- type: input
id: task-sdk-version
attributes:
label: MediaPipe Tasks SDK version
validations:
required: false
- type: input
id: taskname
attributes:
label: Task name (e.g. Image classification, Gesture recognition etc.)
validations:
required: true
- type: input
id: programminglang
attributes:
label: Programming Language and version (e.g. C++, Python, Java)
validations:
required: true
- type: textarea
id: current_model
attributes:
label: Describe the actual behavior
render: shell
validations:
required: true
- type: textarea
id: expected_model
attributes:
label: Describe the expected behaviour
render: shell
validations:
required: true
- type: textarea
id: what-happened_model
attributes:
label: Standalone code/steps you may have used to try to get what you need
description: If there is a problem, provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab, GitHub repo link or anything that we can use to reproduce the problem
render: shell
validations:
required: true
- type: textarea
id: other_info
attributes:
label: Other info / Complete Logs
description: Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached
render: shell
validations:
required: false
+1 -1
View File
@@ -61,7 +61,7 @@ RUN pip3 install tf_slim
RUN ln -s /usr/bin/python3 /usr/bin/python
# Install bazel
ARG BAZEL_VERSION=5.2.0
ARG BAZEL_VERSION=6.1.1
RUN mkdir /bazel && \
wget --no-check-certificate -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/b\
azel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \
+17
View File
@@ -199,3 +199,20 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
===========================================================================
For files under tasks/cc/text/language_detector/custom_ops/utils/utf/
===========================================================================
/*
* The authors of this software are Rob Pike and Ken Thompson.
* Copyright (c) 2002 by Lucent Technologies.
* Permission to use, copy, modify, and distribute this software for any
* purpose without fee is hereby granted, provided that this entire notice
* is included in all copies of any software which is or includes a copy
* or modification of this software and in all copies of the supporting
* documentation for such software.
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
+16
View File
@@ -6,6 +6,20 @@ nav_order: 1
![MediaPipe](https://mediapipe.dev/images/mediapipe_small.png)
----
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
*This notice and web page will be removed on June 1, 2023.*
----
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
--------------------------------------------------------------------------------
## Live ML anywhere
@@ -19,6 +33,8 @@ ML solutions for live and streaming media.
![ready_to_use.png](https://mediapipe.dev/images/ready_to_use_small.png) | ![open_source.png](https://mediapipe.dev/images/open_source_small.png)
***Ready-to-use solutions***: *Cutting-edge ML solutions demonstrating full power of the framework* | ***Free and open source***: *Framework and solutions both under Apache 2.0, fully extensible and customizable*
----
## ML solutions in MediaPipe
Face Detection | Face Mesh | Iris | Hands | Pose | Holistic
+138 -96
View File
@@ -10,33 +10,31 @@ bind(
http_archive(
name = "bazel_skylib",
type = "tar.gz",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "3.7.2")
# ABSL cpp library lts_2021_03_24, patch 2.
# ABSL cpp library lts_2023_01_25.
http_archive(
name = "com_google_absl",
urls = [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.0.tar.gz",
],
# Remove after https://github.com/abseil/abseil-cpp/issues/326 is solved.
patches = [
"@//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff"
"@//third_party:com_google_absl_windows_patch.diff"
],
patch_args = [
"-p1",
],
strip_prefix = "abseil-cpp-20220623.1",
sha256 = "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8"
strip_prefix = "abseil-cpp-20230125.0",
sha256 = "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21"
)
http_archive(
@@ -56,6 +54,76 @@ load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependen
rules_foreign_cc_dependencies()
http_archive(
name = "com_google_protobuf",
sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
strip_prefix = "protobuf-3.19.1",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz"],
patches = [
"@//third_party:com_google_protobuf_fixes.diff"
],
patch_args = [
"-p1",
],
)
# Load Zlib before initializing TensorFlow and the iOS build rules to guarantee
# that the target @zlib//:mini_zlib is available
http_archive(
name = "zlib",
build_file = "@//third_party:zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = [
"http://mirror.bazel.build/zlib.net/fossils/zlib-1.2.11.tar.gz",
"http://zlib.net/fossils/zlib-1.2.11.tar.gz", # 2017-01-15
],
patches = [
"@//third_party:zlib.diff",
],
patch_args = [
"-p1",
],
)
# iOS basic build deps.
http_archive(
name = "build_bazel_rules_apple",
sha256 = "3e2c7ae0ddd181c4053b6491dad1d01ae29011bc322ca87eea45957c76d3a0c3",
url = "https://github.com/bazelbuild/rules_apple/releases/download/2.1.0/rules_apple.2.1.0.tar.gz",
patches = [
# Bypass checking ios unit test runner when building MP ios applications.
"@//third_party:build_bazel_rules_apple_bypass_test_runner_check.diff"
],
patch_args = [
"-p1",
],
)
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:extras.bzl",
"swift_rules_extra_dependencies",
)
swift_rules_extra_dependencies()
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()
# This is used to select all contents of the archives for CMake-based packages to give CMake access to them.
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
@@ -135,27 +203,18 @@ http_archive(
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz"],
)
http_archive(
name = "com_google_protobuf",
sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
strip_prefix = "protobuf-3.19.1",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz"],
patches = [
"@//third_party:com_google_protobuf_fixes.diff"
],
patch_args = [
"-p1",
],
)
load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
load("@//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
flatbuffers()
http_archive(
name = "com_google_audio_tools",
strip_prefix = "multichannel-audio-tools-master",
urls = ["https://github.com/google/multichannel-audio-tools/archive/master.zip"],
strip_prefix = "multichannel-audio-tools-1f6b1319f13282eda6ff1317be13de67f4723860",
urls = ["https://github.com/google/multichannel-audio-tools/archive/1f6b1319f13282eda6ff1317be13de67f4723860.zip"],
sha256 = "fe346e1aee4f5069c4cbccb88706a9a2b2b4cf98aeb91ec1319be77e07dd7435",
repo_mapping = {"@com_github_glog_glog" : "@com_github_glog_glog_no_gflags"},
# TODO: Fix this in AudioTools directly
patches = ["@//third_party:com_google_audio_tools_fixes.diff"],
patch_args = ["-p1"]
)
http_archive(
@@ -174,7 +233,7 @@ http_archive(
"https://github.com/google/sentencepiece/archive/1.0.0.zip",
],
patches = [
"//third_party:com_google_sentencepiece_no_gflag_no_gtest.diff",
"@//third_party:com_google_sentencepiece_no_gflag_no_gtest.diff",
],
patch_args = ["-p1"],
repo_mapping = {"@com_google_glog" : "@com_github_glog_glog_no_gflags"},
@@ -188,8 +247,8 @@ http_archive(
"https://github.com/tensorflow/text/archive/v2.2.0.zip",
],
patches = [
"//third_party:tensorflow_text_remove_tf_deps.diff",
"//third_party:tensorflow_text_a0f49e63.diff",
"@//third_party:tensorflow_text_remove_tf_deps.diff",
"@//third_party:tensorflow_text_a0f49e63.diff",
],
patch_args = ["-p1"],
repo_mapping = {"@com_google_re2": "@com_googlesource_code_re2"},
@@ -271,7 +330,7 @@ new_local_repository(
# For local MacOS builds, the path should point to an opencv@3 installation.
# If you edit the path here, you will also need to update the corresponding
# prefix in "opencv_macos.BUILD".
path = "/usr/local",
path = "/usr/local", # e.g. /usr/local/Cellar for HomeBrew
)
new_local_repository(
@@ -320,63 +379,6 @@ http_archive(
],
)
# Load Zlib before initializing TensorFlow and the iOS build rules to guarantee
# that the target @zlib//:mini_zlib is available
http_archive(
name = "zlib",
build_file = "//third_party:zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = [
"http://mirror.bazel.build/zlib.net/fossils/zlib-1.2.11.tar.gz",
"http://zlib.net/fossils/zlib-1.2.11.tar.gz", # 2017-01-15
],
patches = [
"@//third_party:zlib.diff",
],
patch_args = [
"-p1",
],
)
# iOS basic build deps.
http_archive(
name = "build_bazel_rules_apple",
sha256 = "f94e6dddf74739ef5cb30f000e13a2a613f6ebfa5e63588305a71fce8a8a9911",
url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.3/rules_apple.1.1.3.tar.gz",
patches = [
# Bypass checking ios unit test runner when building MP ios applications.
"@//third_party:build_bazel_rules_apple_bypass_test_runner_check.diff"
],
patch_args = [
"-p1",
],
)
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:extras.bzl",
"swift_rules_extra_dependencies",
)
swift_rules_extra_dependencies()
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()
# More iOS deps.
http_archive(
@@ -456,9 +458,9 @@ http_archive(
)
# TensorFlow repo should always go after the other external dependencies.
# TF on 2022-08-10.
_TENSORFLOW_GIT_COMMIT = "af1d5bc4fbb66d9e6cc1cf89503014a99233583b"
_TENSORFLOW_SHA256 = "f85a5443264fc58a12d136ca6a30774b5bc25ceaf7d114d97f252351b3c3a2cb"
# TF on 2023-03-08.
_TENSORFLOW_GIT_COMMIT = "24f7ee636d62e1f8d8330357f8bbd65956dfb84d"
_TENSORFLOW_SHA256 = "7f8a96dd99215c0cdc77230d3dbce43e60102b64a89203ad04aa09b0a187a4bd"
http_archive(
name = "org_tensorflow",
urls = [
@@ -500,8 +502,8 @@ cc_crosstool(name = "crosstool")
# Node dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "5aae76dced38f784b58d9776e4ab12278bc156a9ed2b1d9fcd3e39921dc88fda",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.1/rules_nodejs-5.7.1.tar.gz"],
sha256 = "94070eff79305be05b7699207fbac5d2608054dd53e6109f7d00d923919ff45a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz"],
)
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
@@ -512,8 +514,8 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install
node_repositories()
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
package_json = "@//:package.json",
yarn_lock = "@//:yarn.lock",
)
# Protobuf for Node dependencies
@@ -539,8 +541,48 @@ load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_
rules_proto_dependencies()
rules_proto_toolchains()
load("//third_party:external_files.bzl", "external_files")
load("@//third_party:external_files.bzl", "external_files")
external_files()
load("//third_party:wasm_files.bzl", "wasm_files")
load("@//third_party:wasm_files.bzl", "wasm_files")
wasm_files()
# Halide
new_local_repository(
name = "halide",
build_file = "@//third_party/halide:BUILD.bazel",
path = "third_party/halide"
)
http_archive(
name = "linux_halide",
sha256 = "d290fadf3f358c94aacf43c883de6468bb98883e26116920afd491ec0e440cd2",
strip_prefix = "Halide-15.0.1-x86-64-linux",
urls = ["https://github.com/halide/Halide/releases/download/v15.0.1/Halide-15.0.1-x86-64-linux-4c63f1befa1063184c5982b11b6a2cc17d4e5815.tar.gz"],
build_file = "@//third_party:halide.BUILD",
)
http_archive(
name = "macos_x86_64_halide",
sha256 = "48ff073ac1aee5c4aca941a4f043cac64b38ba236cdca12567e09d803594a61c",
strip_prefix = "Halide-15.0.1-x86-64-osx",
urls = ["https://github.com/halide/Halide/releases/download/v15.0.1/Halide-15.0.1-x86-64-osx-4c63f1befa1063184c5982b11b6a2cc17d4e5815.tar.gz"],
build_file = "@//third_party:halide.BUILD",
)
http_archive(
name = "macos_arm_64_halide",
sha256 = "db5d20d75fa7463490fcbc79c89f0abec9c23991f787c8e3e831fff411d5395c",
strip_prefix = "Halide-15.0.1-arm-64-osx",
urls = ["https://github.com/halide/Halide/releases/download/v15.0.1/Halide-15.0.1-arm-64-osx-4c63f1befa1063184c5982b11b6a2cc17d4e5815.tar.gz"],
build_file = "@//third_party:halide.BUILD",
)
http_archive(
name = "windows_halide",
sha256 = "61fd049bd75ee918ac6c30d0693aac6048f63f8d1fc4db31001573e58eae8dae",
strip_prefix = "Halide-15.0.1-x86-64-windows",
urls = ["https://github.com/halide/Halide/releases/download/v15.0.1/Halide-15.0.1-x86-64-windows-4c63f1befa1063184c5982b11b6a2cc17d4e5815.zip"],
build_file = "@//third_party:halide.BUILD",
)
+3 -5
View File
@@ -4,12 +4,10 @@ py_binary(
name = "build_py_api_docs",
srcs = ["build_py_api_docs.py"],
deps = [
"//mediapipe",
"//third_party/py/absl:app",
"//third_party/py/absl/flags",
"//third_party/py/tensorflow_docs",
"//third_party/py/mediapipe",
"//third_party/py/tensorflow_docs/api_generator:generate_lib",
"//third_party/py/tensorflow_docs/api_generator:public_api",
],
)
@@ -18,11 +16,11 @@ py_binary(
srcs = ["build_java_api_docs.py"],
data = [
"//third_party/android/sdk:api/26.txt",
"//third_party/java/doclava/current:doclava.jar",
"//third_party/java/doclava:doclet.jar",
"//third_party/java/jsilver:jsilver_jar",
],
env = {
"DOCLAVA_JAR": "$(location //third_party/java/doclava/current:doclava.jar)",
"DOCLAVA_JAR": "$(location //third_party/java/doclava:doclet.jar)",
"JSILVER_JAR": "$(location //third_party/java/jsilver:jsilver_jar)",
},
deps = [
+13
View File
@@ -0,0 +1,13 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="refresh" content="0;url={{ page.target }}"/>
<link rel="canonical" href="{{ page.target }}"/>
<title>Redirecting</title>
</head>
<body>
<p>This page now lives on https://developers.google.com/mediapipe/. If you aren't automatically
redirected, follow this
<a href="{{ page.target }}">link</a>.</p>
</body>
</html>
@@ -0,0 +1,704 @@
---
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/graphs_cpp
title: Building Graphs in C++
parent: Graphs
nav_order: 1
---
# Building Graphs in C++
{: .no_toc }
1. TOC
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
C++ graph builder is a powerful tool for:
* Building complex graphs
* Parametrizing graphs (e.g. setting a delegate on `InferenceCalculator`,
enabling/disabling parts of the graph)
* Deduplicating graphs (e.g. instead of CPU and GPU dedicated graphs in pbtxt
you can have a single code that constructs required graphs, sharing as much
as possible)
* Supporting optional graph inputs/outputs
* Customizing graphs per platform
## Basic Usage
Let's see how C++ graph builder can be used for a simple graph:
```proto
# Graph inputs.
input_stream: "input_tensors"
input_side_packet: "model"
# Graph outputs.
output_stream: "output_tensors"
node {
calculator: "InferenceCalculator"
input_stream: "TENSORS:input_tensors"
input_side_packet: "MODEL:model"
output_stream: "TENSORS:output_tensors"
node_options: {
[type.googleapis.com/mediapipe.InferenceCalculatorOptions] {
# Requesting GPU delegate.
delegate { gpu {} }
}
}
}
```
Function to build the above `CalculatorGraphConfig` may look like:
```c++
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Graph inputs.
Stream<std::vector<Tensor>> input_tensors =
graph.In(0).SetName("input_tensors").Cast<std::vector<Tensor>>();
SidePacket<TfLiteModelPtr> model =
graph.SideIn(0).SetName("model").Cast<TfLiteModelPtr>();
auto& inference_node = graph.AddNode("InferenceCalculator");
auto& inference_opts =
inference_node.GetOptions<InferenceCalculatorOptions>();
// Requesting GPU delegate.
inference_opts.mutable_delegate()->mutable_gpu();
input_tensors.ConnectTo(inference_node.In("TENSORS"));
model.ConnectTo(inference_node.SideIn("MODEL"));
Stream<std::vector<Tensor>> output_tensors =
inference_node.Out("TENSORS").Cast<std::vector<Tensor>>();
// Graph outputs.
output_tensors.SetName("output_tensors").ConnectTo(graph.Out(0));
// Get `CalculatorGraphConfig` to pass it into `CalculatorGraph`
return graph.GetConfig();
}
```
Short summary:
* Use `Graph::In/SideIn` to get graph inputs as `Stream/SidePacket`
* Use `Node::Out/SideOut` to get node outputs as `Stream/SidePacket`
* Use `Stream/SidePacket::ConnectTo` to connect streams and side packets to
node inputs (`Node::In/SideIn`) and graph outputs (`Graph::Out/SideOut`)
* There's a "shortcut" operator `>>` that you can use instead of
`ConnectTo` function (E.g. `x >> node.In("IN")`).
* `Stream/SidePacket::Cast` is used to cast stream or side packet of `AnyType`
(E.g. `Stream<AnyType> in = graph.In(0);`) to a particular type
* Using actual types instead of `AnyType` sets you on a better path for
unleashing graph builder capabilities and improving your graphs
readability.
## Advanced Usage
### Utility Functions
Let's extract inference construction code into a dedicated utility function to
help for readability and code reuse:
```c++
// Updates graph to run inference.
Stream<std::vector<Tensor>> RunInference(
Stream<std::vector<Tensor>> tensors, SidePacket<TfLiteModelPtr> model,
const InferenceCalculatorOptions::Delegate& delegate, Graph& graph) {
auto& inference_node = graph.AddNode("InferenceCalculator");
auto& inference_opts =
inference_node.GetOptions<InferenceCalculatorOptions>();
*inference_opts.mutable_delegate() = delegate;
tensors.ConnectTo(inference_node.In("TENSORS"));
model.ConnectTo(inference_node.SideIn("MODEL"));
return inference_node.Out("TENSORS").Cast<std::vector<Tensor>>();
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Graph inputs.
Stream<std::vector<Tensor>> input_tensors =
graph.In(0).SetName("input_tensors").Cast<std::vector<Tensor>>();
SidePacket<TfLiteModelPtr> model =
graph.SideIn(0).SetName("model").Cast<TfLiteModelPtr>();
InferenceCalculatorOptions::Delegate delegate;
delegate.mutable_gpu();
Stream<std::vector<Tensor>> output_tensors =
RunInference(input_tensors, model, delegate, graph);
// Graph outputs.
output_tensors.SetName("output_tensors").ConnectTo(graph.Out(0));
return graph.GetConfig();
}
```
As a result, `RunInference` provides a clear interface stating what are the
inputs/outputs and their types.
It can be easily reused, e.g. it's only a few lines if you want to run an extra
model inference:
```c++
// Run first inference.
Stream<std::vector<Tensor>> output_tensors =
RunInference(input_tensors, model, delegate, graph);
// Run second inference on the output of the first one.
Stream<std::vector<Tensor>> extra_output_tensors =
RunInference(output_tensors, extra_model, delegate, graph);
```
And you don't need to duplicate names and tags (`InferenceCalculator`,
`TENSORS`, `MODEL`) or introduce dedicated constants here and there - those
details are localized to `RunInference` function.
Tip: extracting `RunInference` and similar functions to dedicated modules (e.g.
inference.h/cc which depends on the inference calculator) enables reuse in
graphs construction code and helps automatically pull in calculator dependencies
(e.g. no need to manually add `:inference_calculator` dep, just let your IDE
include `inference.h` and build cleaner pull in corresponding dependency).
### Utility Classes
And surely, it's not only about functions, in some cases it's beneficial to
introduce utility classes which can help making your graph construction code
more readable and less error prone.
MediaPipe offers `PassThroughCalculator` calculator, which is simply passing
through its inputs:
```
input_stream: "float_value"
input_stream: "int_value"
input_stream: "bool_value"
output_stream: "passed_float_value"
output_stream: "passed_int_value"
output_stream: "passed_bool_value"
node {
calculator: "PassThroughCalculator"
input_stream: "float_value"
input_stream: "int_value"
input_stream: "bool_value"
# The order must be the same as for inputs (or you can use explicit indexes)
output_stream: "passed_float_value"
output_stream: "passed_int_value"
output_stream: "passed_bool_value"
}
```
Let's see the straightforward C++ construction code to create the above graph:
```c++
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Graph inputs.
Stream<float> float_value = graph.In(0).SetName("float_value").Cast<float>();
Stream<int> int_value = graph.In(1).SetName("int_value").Cast<int>();
Stream<bool> bool_value = graph.In(2).SetName("bool_value").Cast<bool>();
auto& pass_node = graph.AddNode("PassThroughCalculator");
float_value.ConnectTo(pass_node.In("")[0]);
int_value.ConnectTo(pass_node.In("")[1]);
bool_value.ConnectTo(pass_node.In("")[2]);
Stream<float> passed_float_value = pass_node.Out("")[0].Cast<float>();
Stream<int> passed_int_value = pass_node.Out("")[1].Cast<int>();
Stream<bool> passed_bool_value = pass_node.Out("")[2].Cast<bool>();
// Graph outputs.
passed_float_value.SetName("passed_float_value").ConnectTo(graph.Out(0));
passed_int_value.SetName("passed_int_value").ConnectTo(graph.Out(1));
passed_bool_value.SetName("passed_bool_value").ConnectTo(graph.Out(2));
// Get `CalculatorGraphConfig` to pass it into `CalculatorGraph`
return graph.GetConfig();
}
```
While `pbtxt` representation maybe error prone (when we have many inputs to pass
through), C++ code looks even worse: repeated empty tags and `Cast` calls. Let's
see how we can do better by introducing a `PassThroughNodeBuilder`:
```c++
class PassThroughNodeBuilder {
public:
explicit PassThroughNodeBuilder(Graph& graph)
: node_(graph.AddNode("PassThroughCalculator")) {}
template <typename T>
Stream<T> PassThrough(Stream<T> stream) {
stream.ConnectTo(node_.In(index_));
return node_.Out(index_++).Cast<T>();
}
private:
int index_ = 0;
GenericNode& node_;
};
```
And now graph construction code can look like:
```c++
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Graph inputs.
Stream<float> float_value = graph.In(0).SetName("float_value").Cast<float>();
Stream<int> int_value = graph.In(1).SetName("int_value").Cast<int>();
Stream<bool> bool_value = graph.In(2).SetName("bool_value").Cast<bool>();
PassThroughNodeBuilder pass_node_builder(graph);
Stream<float> passed_float_value = pass_node_builder.PassThrough(float_value);
Stream<int> passed_int_value = pass_node_builder.PassThrough(int_value);
Stream<bool> passed_bool_value = pass_node_builder.PassThrough(bool_value);
// Graph outputs.
passed_float_value.SetName("passed_float_value").ConnectTo(graph.Out(0));
passed_int_value.SetName("passed_int_value").ConnectTo(graph.Out(1));
passed_bool_value.SetName("passed_bool_value").ConnectTo(graph.Out(2));
// Get `CalculatorGraphConfig` to pass it into `CalculatorGraph`
return graph.GetConfig();
}
```
Now you can't have incorrect order or index in your pass through construction
code and save some typing by guessing the type for `Cast` from the `PassThrough`
input.
Tip: the same as for the `RunInference` function, extracting
`PassThroughNodeBuilder` and similar utility classes into dedicated modules
enables reuse in graph construction code and helps to automatically pull in the
corresponding calculator dependencies.
## Dos and Don'ts
### Define graph inputs at the very beginning if possible
```c++ {.bad}
Stream<D> RunSomething(Stream<A> a, Stream<B> b, Graph& graph) {
Stream<C> c = graph.In(2).SetName("c").Cast<C>(); // Bad.
// ...
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
Stream<A> a = graph.In(0).SetName("a").Cast<A>();
// 10/100/N lines of code.
Stream<B> b = graph.In(1).SetName("b").Cast<B>() // Bad.
Stream<D> d = RunSomething(a, b, graph);
// ...
return graph.GetConfig();
}
```
In the above code:
* It can be hard to guess how many inputs you have in the graph.
* Can be error prone overall and hard to maintain in future (e.g. is it a
correct index? name? what if some inputs are removed or made optional?
etc.).
* `RunSomething` reuse is limited because other graphs may have different
inputs
Instead, define your graph inputs at the very beginning of your graph builder:
```c++ {.good}
Stream<D> RunSomething(Stream<A> a, Stream<B> b, Stream<C> c, Graph& graph) {
// ...
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).SetName("a").Cast<A>();
Stream<B> b = graph.In(1).SetName("b").Cast<B>();
Stream<C> c = graph.In(2).SetName("c").Cast<C>();
// 10/100/N lines of code.
Stream<D> d = RunSomething(a, b, c, graph);
// ...
return graph.GetConfig();
}
```
Use `std::optional` if you have an input stream or side packet that is not
always defined and put it at the very beginning:
```c++ {.good}
std::optional<Stream<A>> a;
if (needs_a) {
a = graph.In(0).SetName(a).Cast<A>();
}
```
Note: of course, there can be exceptions - for example, there can be a use case
where calling `RunSomething1(..., graph)`, ..., `RunSomethingN(..., graph)` is
**intended to add new inputs**, so afterwards you can iterate over them and feed
only added inputs into the graph. However, in any case, try to make it easy for
readers to find out what graph inputs it has or may have.
### Define graph outputs at the very end
```c++ {.bad}
void RunSomething(Stream<Input> input, Graph& graph) {
// ...
node.Out("OUTPUT_F")
.SetName("output_f").ConnectTo(graph.Out(2)); // Bad.
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// 10/100/N lines of code.
node.Out("OUTPUT_D")
.SetName("output_d").ConnectTo(graph.Out(0)); // Bad.
// 10/100/N lines of code.
node.Out("OUTPUT_E")
.SetName("output_e").ConnectTo(graph.Out(1)); // Bad.
// 10/100/N lines of code.
RunSomething(input, graph);
// ...
return graph.GetConfig();
}
```
In the above code:
* It can be hard to guess how many outputs you have in the graph.
* Can be error prone overall and hard to maintain in future (e.g. is it a
correct index? name? what if some outpus are removed or made optional?
etc.).
* `RunSomething` reuse is limited as other graphs may have different outputs
Instead, define your graph outputs at the very end of your graph builder:
```c++ {.good}
Stream<F> RunSomething(Stream<Input> input, Graph& graph) {
// ...
return node.Out("OUTPUT_F").Cast<F>();
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// 10/100/N lines of code.
Stream<D> d = node.Out("OUTPUT_D").Cast<D>();
// 10/100/N lines of code.
Stream<E> e = node.Out("OUTPUT_E").Cast<E>();
// 10/100/N lines of code.
Stream<F> f = RunSomething(input, graph);
// ...
// Outputs.
d.SetName("output_d").ConnectTo(graph.Out(0));
e.SetName("output_e").ConnectTo(graph.Out(1));
f.SetName("output_f").ConnectTo(graph.Out(2));
return graph.GetConfig();
}
```
### Keep nodes decoupled from each other
In MediaPipe, packet streams and side packets are as meaningful as processing
nodes. And any node input requirements and output products are expressed clearly
and independently in terms of the streams and side packets it consumes and
produces.
```c++ {.bad}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
auto& node1 = graph.AddNode("Calculator1");
a.ConnectTo(node1.In("INPUT"));
auto& node2 = graph.AddNode("Calculator2");
node1.Out("OUTPUT").ConnectTo(node2.In("INPUT")); // Bad.
auto& node3 = graph.AddNode("Calculator3");
node1.Out("OUTPUT").ConnectTo(node3.In("INPUT_B")); // Bad.
node2.Out("OUTPUT").ConnectTo(node3.In("INPUT_C")); // Bad.
auto& node4 = graph.AddNode("Calculator4");
node1.Out("OUTPUT").ConnectTo(node4.In("INPUT_B")); // Bad.
node2.Out("OUTPUT").ConnectTo(node4.In("INPUT_C")); // Bad.
node3.Out("OUTPUT").ConnectTo(node4.In("INPUT_D")); // Bad.
// Outputs.
node1.Out("OUTPUT").SetName("b").ConnectTo(graph.Out(0)); // Bad.
node2.Out("OUTPUT").SetName("c").ConnectTo(graph.Out(1)); // Bad.
node3.Out("OUTPUT").SetName("d").ConnectTo(graph.Out(2)); // Bad.
node4.Out("OUTPUT").SetName("e").ConnectTo(graph.Out(3)); // Bad.
return graph.GetConfig();
}
```
In the above code:
* Nodes are coupled to each other, e.g. `node4` knows where its inputs are
coming from (`node1`, `node2`, `node3`) and it complicates refactoring,
maintenance and code reuse
* Such usage pattern is a downgrade from proto representation, where nodes
are decoupled by default.
* `node#.Out("OUTPUT")` calls are duplicated and readability suffers as you
could use cleaner names instead and also provide an actual type.
So, to fix the above issues you can write the following graph construction code:
```c++ {.good}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
// `node1` usage is limited to 3 lines below.
auto& node1 = graph.AddNode("Calculator1");
a.ConnectTo(node1.In("INPUT"));
Stream<B> b = node1.Out("OUTPUT").Cast<B>();
// `node2` usage is limited to 3 lines below.
auto& node2 = graph.AddNode("Calculator2");
b.ConnectTo(node2.In("INPUT"));
Stream<C> c = node2.Out("OUTPUT").Cast<C>();
// `node3` usage is limited to 4 lines below.
auto& node3 = graph.AddNode("Calculator3");
b.ConnectTo(node3.In("INPUT_B"));
c.ConnectTo(node3.In("INPUT_C"));
Stream<D> d = node3.Out("OUTPUT").Cast<D>();
// `node4` usage is limited to 5 lines below.
auto& node4 = graph.AddNode("Calculator4");
b.ConnectTo(node4.In("INPUT_B"));
c.ConnectTo(node4.In("INPUT_C"));
d.ConnectTo(node4.In("INPUT_D"));
Stream<E> e = node4.Out("OUTPUT").Cast<E>();
// Outputs.
b.SetName("b").ConnectTo(graph.Out(0));
c.SetName("c").ConnectTo(graph.Out(1));
d.SetName("d").ConnectTo(graph.Out(2));
e.SetName("e").ConnectTo(graph.Out(3));
return graph.GetConfig();
}
```
Now, if needed, you can easily remove `node1` and make `b` a graph input and no
updates are needed to `node2`, `node3`, `node4` (same as in proto representation
by the way), because they are decoupled from each other.
Overall, the above code replicates the proto graph more closely:
```proto
input_stream: "a"
node {
calculator: "Calculator1"
input_stream: "INPUT:a"
output_stream: "OUTPUT:b"
}
node {
calculator: "Calculator2"
input_stream: "INPUT:b"
output_stream: "OUTPUT:C"
}
node {
calculator: "Calculator3"
input_stream: "INPUT_B:b"
input_stream: "INPUT_C:c"
output_stream: "OUTPUT:d"
}
node {
calculator: "Calculator4"
input_stream: "INPUT_B:b"
input_stream: "INPUT_C:c"
input_stream: "INPUT_D:d"
output_stream: "OUTPUT:e"
}
output_stream: "b"
output_stream: "c"
output_stream: "d"
output_stream: "e"
```
On top of that, now you can extract utility functions for further reuse in other graphs:
```c++ {.good}
Stream<B> RunCalculator1(Stream<A> a, Graph& graph) {
auto& node = graph.AddNode("Calculator1");
a.ConnectTo(node.In("INPUT"));
return node.Out("OUTPUT").Cast<B>();
}
Stream<C> RunCalculator2(Stream<B> b, Graph& graph) {
auto& node = graph.AddNode("Calculator2");
b.ConnectTo(node.In("INPUT"));
return node.Out("OUTPUT").Cast<C>();
}
Stream<D> RunCalculator3(Stream<B> b, Stream<C> c, Graph& graph) {
auto& node = graph.AddNode("Calculator3");
b.ConnectTo(node.In("INPUT_B"));
c.ConnectTo(node.In("INPUT_C"));
return node.Out("OUTPUT").Cast<D>();
}
Stream<E> RunCalculator4(Stream<B> b, Stream<C> c, Stream<D> d, Graph& graph) {
auto& node = graph.AddNode("Calculator4");
b.ConnectTo(node.In("INPUT_B"));
c.ConnectTo(node.In("INPUT_C"));
d.ConnectTo(node.In("INPUT_D"));
return node.Out("OUTPUT").Cast<E>();
}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
Stream<B> b = RunCalculator1(a, graph);
Stream<C> c = RunCalculator2(b, graph);
Stream<D> d = RunCalculator3(b, c, graph);
Stream<E> e = RunCalculator4(b, c, d, graph);
// Outputs.
b.SetName("b").ConnectTo(graph.Out(0));
c.SetName("c").ConnectTo(graph.Out(1));
d.SetName("d").ConnectTo(graph.Out(2));
e.SetName("e").ConnectTo(graph.Out(3));
return graph.GetConfig();
}
```
### Separate nodes for better readability
```c++ {.bad}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
auto& node1 = graph.AddNode("Calculator1");
a.ConnectTo(node1.In("INPUT"));
Stream<B> b = node1.Out("OUTPUT").Cast<B>();
auto& node2 = graph.AddNode("Calculator2");
b.ConnectTo(node2.In("INPUT"));
Stream<C> c = node2.Out("OUTPUT").Cast<C>();
auto& node3 = graph.AddNode("Calculator3");
b.ConnectTo(node3.In("INPUT_B"));
c.ConnectTo(node3.In("INPUT_C"));
Stream<D> d = node3.Out("OUTPUT").Cast<D>();
auto& node4 = graph.AddNode("Calculator4");
b.ConnectTo(node4.In("INPUT_B"));
c.ConnectTo(node4.In("INPUT_C"));
d.ConnectTo(node4.In("INPUT_D"));
Stream<E> e = node4.Out("OUTPUT").Cast<E>();
// Outputs.
b.SetName("b").ConnectTo(graph.Out(0));
c.SetName("c").ConnectTo(graph.Out(1));
d.SetName("d").ConnectTo(graph.Out(2));
e.SetName("e").ConnectTo(graph.Out(3));
return graph.GetConfig();
}
```
In the above code, it can be hard to grasp the idea where each node begins and
ends. To improve this and help your code readers, you can simply have blank
lines before and after each node:
```c++ {.good}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
auto& node1 = graph.AddNode("Calculator1");
a.ConnectTo(node1.In("INPUT"));
Stream<B> b = node1.Out("OUTPUT").Cast<B>();
auto& node2 = graph.AddNode("Calculator2");
b.ConnectTo(node2.In("INPUT"));
Stream<C> c = node2.Out("OUTPUT").Cast<C>();
auto& node3 = graph.AddNode("Calculator3");
b.ConnectTo(node3.In("INPUT_B"));
c.ConnectTo(node3.In("INPUT_C"));
Stream<D> d = node3.Out("OUTPUT").Cast<D>();
auto& node4 = graph.AddNode("Calculator4");
b.ConnectTo(node4.In("INPUT_B"));
c.ConnectTo(node4.In("INPUT_C"));
d.ConnectTo(node4.In("INPUT_D"));
Stream<E> e = node4.Out("OUTPUT").Cast<E>();
// Outputs.
b.SetName("b").ConnectTo(graph.Out(0));
c.SetName("c").ConnectTo(graph.Out(1));
d.SetName("d").ConnectTo(graph.Out(2));
e.SetName("e").ConnectTo(graph.Out(3));
return graph.GetConfig();
}
```
Also, the above representation matches `CalculatorGraphConfig` proto
representation better.
If you extract nodes into utility functions, they are scoped within functions
already and it's clear where they begin and end, so it's completely fine to
have:
```c++ {.good}
CalculatorGraphConfig BuildGraph() {
Graph graph;
// Inputs.
Stream<A> a = graph.In(0).Cast<A>();
Stream<B> b = RunCalculator1(a, graph);
Stream<C> c = RunCalculator2(b, graph);
Stream<D> d = RunCalculator3(b, c, graph);
Stream<E> e = RunCalculator4(b, c, d, graph);
// Outputs.
b.SetName("b").ConnectTo(graph.Out(0));
c.SetName("c").ConnectTo(graph.Out(1));
d.SetName("d").ConnectTo(graph.Out(2));
e.SetName("e").ConnectTo(graph.Out(3));
return graph.GetConfig();
}
```
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/calculators
title: Calculators
parent: Framework Concepts
nav_order: 1
@@ -12,6 +13,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Each calculator is a node of a graph. We describe how to create a new
calculator, how to initialize a calculator, how to perform its calculations,
input and output streams, timestamps, and options. Each node in the graph is
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/overview
title: Framework Concepts
nav_order: 5
has_children: true
@@ -13,6 +14,12 @@ has_toc: false
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## The basics
### Packet
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/gpu
title: GPU
parent: Framework Concepts
nav_order: 5
@@ -12,6 +13,12 @@ nav_order: 5
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Overview
MediaPipe supports calculator nodes for GPU compute and rendering, and allows combining multiple GPU nodes, as well as mixing them with CPU based calculator nodes. There exist several GPU APIs on mobile platforms (eg, OpenGL ES, Metal and Vulkan). MediaPipe does not attempt to offer a single cross-API GPU abstraction. Individual nodes can be written using different APIs, allowing them to take advantage of platform specific features when needed.
+56 -20
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/graphs
title: Graphs
parent: Framework Concepts
nav_order: 2
@@ -12,31 +13,37 @@ nav_order: 2
{:toc}
---
## GraphConfig
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
A `GraphConfig` is a specification that describes the topology and functionality
of a MediaPipe graph. In the specification, a node in the graph represents an
instance of a particular calculator. All the necessary configurations of the
node, such its type, inputs and outputs must be described in the specification.
Description of the node can also include several optional fields, such as
----
## Graph
A `CalculatorGraphConfig` proto specifies the topology and functionality of a
MediaPipe graph. Each `node` in the graph represents a particular calculator or
subgraph, and specifies necessary configurations, such as registered
calculator/subgraph type, inputs, outputs and optional fields, such as
node-specific options, input policy and executor, discussed in
[Synchronization](synchronization.md).
`GraphConfig` has several other fields to configure the global graph-level
settings, eg, graph executor configs, number of threads, and maximum queue size
`CalculatorGraphConfig` has several other fields to configure global graph-level
settings, e.g. graph executor configs, number of threads, and maximum queue size
of input streams. Several graph-level settings are useful for tuning the
performance of the graph on different platforms (eg, desktop v.s. mobile). For
performance of the graph on different platforms (e.g., desktop v.s. mobile). For
instance, on mobile, attaching a heavy model-inference calculator to a separate
executor can improve the performance of a real-time application since this
enables thread locality.
Below is a trivial `GraphConfig` example where we have series of passthrough
calculators :
Below is a trivial `CalculatorGraphConfig` example where we have series of
passthrough calculators :
```proto
# This graph named main_pass_throughcals_nosubgraph.pbtxt contains 4
# passthrough calculators.
input_stream: "in"
output_stream: "out"
node {
calculator: "PassThroughCalculator"
input_stream: "in"
@@ -55,17 +62,46 @@ node {
node {
calculator: "PassThroughCalculator"
input_stream: "out3"
output_stream: "out4"
output_stream: "out"
}
```
MediaPipe offers an alternative `C++` representation for complex graphs (e.g. ML pipelines, handling model metadata, optional nodes, etc.). The above graph may look like:
```c++
CalculatorGraphConfig BuildGraphConfig() {
Graph graph;
// Graph inputs
Stream<AnyType> in = graph.In(0).SetName("in");
auto pass_through_fn = [](Stream<AnyType> in,
Graph& graph) -> Stream<AnyType> {
auto& node = graph.AddNode("PassThroughCalculator");
in.ConnectTo(node.In(0));
return node.Out(0);
};
Stream<AnyType> out1 = pass_through_fn(in, graph);
Stream<AnyType> out2 = pass_through_fn(out1, graph);
Stream<AnyType> out3 = pass_through_fn(out2, graph);
Stream<AnyType> out4 = pass_through_fn(out3, graph);
// Graph outputs
out4.SetName("out").ConnectTo(graph.Out(0));
return graph.GetConfig();
}
```
See more details in [Building Graphs in C++](building_graphs_cpp.md)
## Subgraph
To modularize a `CalculatorGraphConfig` into sub-modules and assist with re-use
of perception solutions, a MediaPipe graph can be defined as a `Subgraph`. The
public interface of a subgraph consists of a set of input and output streams
similar to a calculator's public interface. The subgraph can then be included in
an `CalculatorGraphConfig` as if it were a calculator. When a MediaPipe graph is
a `CalculatorGraphConfig` as if it were a calculator. When a MediaPipe graph is
loaded from a `CalculatorGraphConfig`, each subgraph node is replaced by the
corresponding graph of calculators. As a result, the semantics and performance
of the subgraph is identical to the corresponding graph of calculators.
@@ -151,7 +187,7 @@ protobuf specified for a MediaPipe calculator. These "graph options" can be
specified where a graph is invoked, and used to populate calculator options and
subgraph options within the graph.
In a CalculatorGraphConfig, graph options can be specified for a subgraph
In a `CalculatorGraphConfig`, graph options can be specified for a subgraph
exactly like calculator options, as shown below:
```
@@ -178,7 +214,7 @@ node {
}
```
In a CalculatorGraphConfig, graph options can be accepted and used to populate
In a `CalculatorGraphConfig`, graph options can be accepted and used to populate
calculator options, as shown below:
```
@@ -188,7 +224,7 @@ graph_options: {
node: {
calculator: "ImageToTensorCalculator"
input_stream: "IMAGE:multi_backend_image"
input_stream: "IMAGE:image"
node_options: {
[type.googleapis.com/mediapipe.ImageToTensorCalculatorOptions] {
keep_aspect_ratio: true
@@ -247,9 +283,9 @@ NOTE: The current approach is experimental and subject to change. We welcome
your feedback.
Please use the `CalculatorGraphTest.Cycle` unit test in
`mediapipe/framework/calculator_graph_test.cc` as sample code. Shown
below is the cyclic graph in the test. The `sum` output of the adder is the sum
of the integers generated by the integer source calculator.
`mediapipe/framework/calculator_graph_test.cc` as sample code. Shown below is
the cyclic graph in the test. The `sum` output of the adder is the sum of the
integers generated by the integer source calculator.
![a cyclic graph that adds a stream of integers](https://mediapipe.dev/images/cyclic_integer_sum_graph.svg "A cyclic graph")
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/packets
title: Packets
parent: Framework Concepts
nav_order: 3
@@ -12,6 +13,12 @@ nav_order: 3
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Calculators communicate by sending and receiving packets. Typically a single
packet is sent along each input stream at each input timestamp. A packet can
contain any kind of data, such as a single frame of video or a single integer
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/realtime_streams
title: Real-time Streams
parent: Framework Concepts
nav_order: 6
@@ -12,6 +13,12 @@ nav_order: 6
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Real-time timestamps
MediaPipe calculator graphs are often used to process streams of video or audio
+12 -5
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/framework_concepts/synchronization
title: Synchronization
parent: Framework Concepts
nav_order: 4
@@ -12,6 +13,12 @@ nav_order: 4
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Scheduling mechanics
Data processing in a MediaPipe graph occurs inside processing nodes defined as
@@ -112,14 +119,14 @@ Warning: On the other hand, it is not guaranteed that an input packet will
always be available for all streams.
To explain how it works, we need to introduce the definition of a settled
timestamp. We say that a timestamp in a stream is *settled* if it lower than the
timestamp bound. In other words, a timestamp is settled for a stream once the
state of the input at that timestamp is irrevocably known: either there is a
timestamp. We say that a timestamp in a stream is *settled* if it is lower than
the timestamp bound. In other words, a timestamp is settled for a stream once
the state of the input at that timestamp is irrevocably known: either there is a
packet, or there is the certainty that a packet with that timestamp will not
arrive.
Note: For this reason, MediaPipe also allows a stream producer to explicitly
advance the timestamp bound farther that what the last packet implies, i.e. to
advance the timestamp bound farther than what the last packet implies, i.e. to
provide a tighter bound. This can allow the downstream nodes to settle their
inputs sooner.
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/android
title: MediaPipe on Android
parent: Getting Started
has_children: true
@@ -14,6 +15,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Please follow instructions below to build Android example apps in the supported
MediaPipe [solutions](../solutions/solutions.md). To learn more about these
example apps, start from [Hello World! on Android](./hello_world_android.md).
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/android_archive_library
title: MediaPipe Android Archive
parent: MediaPipe on Android
grand_parent: Getting Started
@@ -13,6 +14,12 @@ nav_order: 3
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
***Experimental Only***
The MediaPipe Android Archive (AAR) library is a convenient way to use MediaPipe
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: MediaPipe Android Solutions
parent: MediaPipe on Android
grand_parent: Getting Started
@@ -13,6 +14,12 @@ nav_order: 2
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
MediaPipe Android Solution APIs (currently in alpha) are available in:
* [MediaPipe Face Detection](../solutions/face_detection#android-solution-api)
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: Building MediaPipe Examples
parent: Getting Started
nav_exclude: true
@@ -12,6 +13,12 @@ nav_exclude: true
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
### Android
Please see these [instructions](./android.md).
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/cpp
title: MediaPipe in C++
parent: Getting Started
has_children: true
@@ -14,6 +15,12 @@ nav_order: 5
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Please follow instructions below to build C++ command-line example apps in the
supported MediaPipe [solutions](../solutions/solutions.md). To learn more about
these example apps, start from [Hello World! in C++](./hello_world_cpp.md).
+12 -5
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/faq
title: FAQ
parent: Getting Started
nav_order: 9
@@ -12,6 +13,12 @@ nav_order: 9
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
### How to convert ImageFrames and GpuBuffers
The Calculators [`ImageFrameToGpuBufferCalculator`] and
@@ -46,7 +53,7 @@ calculators need only to be *thread-compatible* and not *thread-safe*.
In order to enable one calculator to process multiple inputs in parallel, there
are two possible approaches:
1. Define multiple calulator nodes and dispatch input packets to all nodes.
1. Define multiple calculator nodes and dispatch input packets to all nodes.
2. Make the calculator thread-safe and configure its [`max_in_flight`] setting.
The first approach can be followed using the calculators designed to distribute
@@ -59,7 +66,7 @@ The second approach allows up to [`max_in_flight`] invocations of the
packets from [`CalculatorBase::Process`] are automatically ordered by timestamp
before they are passed along to downstream calculators.
With either aproach, you must be aware that the calculator running in parallel
With either approach, you must be aware that the calculator running in parallel
cannot maintain internal state in the same way as a normal sequential
calculator.
@@ -88,12 +95,12 @@ while the application is running:
The first approach has the advantage of leveraging [`CalculatorGraphConfig`]
processing tools such as "subgraphs". The second approach has the advantage of
allowing active calculators and packets to remain in-flight while settings
change. Mediapipe contributors are currently investigating alternative approaches
change. MediaPipe contributors are currently investigating alternative approaches
to achieve both of these advantages.
### How to process realtime input streams
The mediapipe framework can be used to process data streams either online or
The MediaPipe framework can be used to process data streams either online or
offline. For offline processing, packets are pushed into the graph as soon as
calculators are ready to process those packets. For online processing, one
packet for each frame is pushed into the graph as that frame is recorded.
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: Getting Started
nav_order: 2
has_children: true
@@ -11,3 +12,9 @@ has_children: true
1. TOC
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/gpu_support
title: GPU Support
parent: Getting Started
nav_order: 7
@@ -12,6 +13,12 @@ nav_order: 7
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## OpenGL ES Support
MediaPipe supports OpenGL ES up to version 3.2 on Android/Linux and up to ES 3.0
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/hello_world_android
title: Hello World! on Android
parent: MediaPipe on Android
grand_parent: Getting Started
@@ -13,6 +14,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Introduction
This codelab uses MediaPipe on an Android device.
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/hello_world_cpp
title: Hello World! in C++
parent: MediaPipe in C++
grand_parent: Getting Started
@@ -13,6 +14,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
1. Ensure you have a working version of MediaPipe. See
[installation instructions](./install.md).
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/hello_world_ios
title: Hello World! on iOS
parent: MediaPipe on iOS
grand_parent: Getting Started
@@ -13,6 +14,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Introduction
This codelab uses MediaPipe on an iOS device.
+10 -3
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/help
title: Getting Help
parent: Getting Started
nav_order: 8
@@ -12,6 +13,12 @@ nav_order: 8
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Technical questions
For help with technical or algorithmic questions, visit
@@ -37,8 +44,8 @@ If you open a GitHub issue, here is our policy:
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device**:
- **Bazel version**:
- **Android Studio, NDK, SDK versions (if issue is related to building in mobile dev enviroment)**:
- **Xcode & Tulsi version (if issue is related to building in mobile dev enviroment)**:
- **Android Studio, NDK, SDK versions (if issue is related to building in mobile dev environment)**:
- **Xcode & Tulsi version (if issue is related to building in mobile dev environment)**:
- **Exact steps to reproduce**:
### Describe the problem
+23 -9
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/install
title: Installation
parent: Getting Started
nav_order: 6
@@ -12,6 +13,12 @@ nav_order: 6
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Note: To interoperate with OpenCV, OpenCV 3.x to 4.1 are preferred. OpenCV
2.x currently works but interoperability support may be deprecated in the
future.
@@ -35,7 +42,7 @@ install --user six`.
```bash
$ cd $HOME
$ git clone https://github.com/google/mediapipe.git
$ git clone --depth 1 https://github.com/google/mediapipe.git
# Change directory into MediaPipe root directory
$ cd mediapipe
@@ -67,6 +74,13 @@ install --user six`.
libopencv-video-dev
```
**Note**. On Debian 11/Ubuntu 21.04 where OpenCV 4.5 is installed with
`libopencv-video-dev`, `libopencv-contrib-dev` should also be installed.
```bash
$ sudo apt-get install -y libopencv-contrib-dev
```
MediaPipe's [`opencv_linux.BUILD`] and [`WORKSPACE`] are already configured
for OpenCV 2/3 and should work correctly on any architecture:
@@ -287,7 +301,7 @@ build issues.
2. Checkout MediaPipe repository.
```bash
$ git clone https://github.com/google/mediapipe.git
$ git clone --depth 1 https://github.com/google/mediapipe.git
# Change directory into MediaPipe root directory
$ cd mediapipe
@@ -416,7 +430,7 @@ build issues.
3. Checkout MediaPipe repository.
```bash
$ git clone https://github.com/google/mediapipe.git
$ git clone --depth 1 https://github.com/google/mediapipe.git
$ cd mediapipe
```
@@ -569,7 +583,7 @@ next section.
Option 1. Follow
[the official Bazel documentation](https://docs.bazel.build/versions/master/install-windows.html)
to install Bazel 5.2.0 or higher.
to install Bazel 6.1.1 or higher.
Option 2. Follow the official
[Bazel documentation](https://docs.bazel.build/versions/master/install-bazelisk.html)
@@ -590,7 +604,7 @@ next section.
7. Checkout MediaPipe repository.
```
C:\Users\Username\mediapipe_repo> git clone https://github.com/google/mediapipe.git
C:\Users\Username\mediapipe_repo> git clone --depth 1 https://github.com/google/mediapipe.git
# Change directory into MediaPipe root directory
C:\Users\Username\mediapipe_repo> cd mediapipe
@@ -651,7 +665,7 @@ cameras. Alternatively, you use a video file as input.
1. Follow the
[instruction](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to
install Windows Sysystem for Linux (Ubuntu).
install Windows Subsystem for Linux (Ubuntu).
2. Install Windows ADB and start the ADB server in Windows.
@@ -680,7 +694,7 @@ cameras. Alternatively, you use a video file as input.
6. Checkout MediaPipe repository.
```bash
username@DESKTOP-TMVLBJ1:~$ git clone https://github.com/google/mediapipe.git
username@DESKTOP-TMVLBJ1:~$ git clone --depth 1 https://github.com/google/mediapipe.git
username@DESKTOP-TMVLBJ1:~$ cd mediapipe
```
@@ -771,7 +785,7 @@ This will use a Docker image that will isolate mediapipe's installation from the
2. Build a docker image with tag "mediapipe".
```bash
$ git clone https://github.com/google/mediapipe.git
$ git clone --depth 1 https://github.com/google/mediapipe.git
$ cd mediapipe
$ docker build --tag=mediapipe .
+16 -5
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/ios
title: MediaPipe on iOS
parent: Getting Started
has_children: true
@@ -14,6 +15,12 @@ nav_order: 2
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
Please follow instructions below to build iOS example apps in the supported
MediaPipe [solutions](../solutions/solutions.md). To learn more about these
example apps, start from, start from
@@ -91,6 +98,10 @@ allows you to make use of automatic provisioning (see later section).
This will install `Tulsi.app` inside the `Applications` directory in your
home directory.
**Note**: Please ensure the `xcode_version` in the
[`build_and_run.sh`](https://github.com/bazelbuild/tulsi/blob/b1d0108e6a93dbe8ab01529b2c607b6b651f0759/build_and_run.sh#L26)
file in tulsi repo is the same version as installed in your system.
2. Open `mediapipe/Mediapipe.tulsiproj` using the Tulsi app.
Tip: If Tulsi displays an error saying "Bazel could not be found", press the
@@ -109,8 +120,8 @@ allows you to make use of automatic provisioning (see later section).
To install applications on an iOS device, you need a provisioning profile. There
are two options:
1. Automatic provisioning. This allows you to build and install an app to your
personal device. The provisining profile is managed by Xcode, and has to be
1. Automatic provisioning. This allows you to build and install an app on your
personal device. The provisioning profile is managed by Xcode, and has to be
updated often (it is valid for about a week).
2. Custom provisioning. This uses a provisioning profile associated with an
@@ -175,7 +186,7 @@ Profiles"`. If there are none, generate and download a profile on
Note: if you had previously set up automatic provisioning, you should remove the
`provisioning_profile.mobileprovision` symlink in each example's directory,
since it will take precedence over the common one. You can also overwrite it
with you own profile if you need a different profile for different apps.
with your own profile if you need a different profile for different apps.
1. Open `mediapipe/examples/ios/bundle_id.bzl`, and change the
`BUNDLE_ID_PREFIX` to a prefix associated with your provisioning profile.
@@ -192,7 +203,7 @@ Note: When you ask Xcode to run an app, by default it will use the Debug
configuration. Some of our demos are computationally heavy; you may want to use
the Release configuration for better performance.
Note: Due to an imcoptibility caused by one of our dependencies, MediaPipe
Note: Due to an incompatibility caused by one of our dependencies, MediaPipe
cannot be used for apps running on the iPhone Simulator on Apple Silicon (M1).
Tip: To switch build configuration in Xcode, click on the target menu, choose
+10 -3
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: MediaPipe in JavaScript
parent: Getting Started
nav_order: 4
@@ -12,6 +13,12 @@ nav_order: 4
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We are moving to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe starting April 3, 2023.*
----
## Ready-to-use JavaScript Solutions
MediaPipe currently offers the following solutions:
@@ -29,11 +36,11 @@ Solution | NPM Package | Example
Click on a solution link above for more information, including API and code
snippets.
### Supported plaforms:
### Supported platforms:
| Browser | Platform | Notes |
| ------- | ----------------------- | -------------------------------------- |
| Chrome | Android / Windows / Mac | Pixel 4 and older unsupported. Fuschia |
| Chrome | Android / Windows / Mac | Pixel 4 and older unsupported. Fuchsia |
| | | unsupported. |
| Chrome | iOS | Camera unavailable in Chrome on iOS. |
| Safari | iPad/iPhone/Mac | iOS and Safari on iPad / iPhone / |
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: MediaPipe in Python
parent: Getting Started
has_children: true
@@ -14,6 +15,12 @@ nav_order: 3
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Ready-to-use Python Solutions
MediaPipe offers ready-to-use yet customizable Python solutions as a prebuilt
+9 -4
View File
@@ -1,6 +1,6 @@
---
layout: default
title: MediaPipe Python Framework
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/python_framework
parent: MediaPipe in Python
grand_parent: Getting Started
nav_order: 1
@@ -12,6 +12,11 @@ nav_order: 1
1. TOC
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
The MediaPipe Python framework grants direct access to the core components of
the MediaPipe C++ framework such as Timestamp, Packet, and CalculatorGraph,
@@ -76,7 +81,7 @@ np.ndarray | mp::Matrix | create_ma
Google Proto Message | Google Proto Message | create_proto(proto) | get_proto(packet)
List\[Proto\] | std::vector\<Proto\> | n/a | get_proto_list(packet)
It's not uncommon that users create custom C++ classes and and send those into
It's not uncommon that users create custom C++ classes and send those into
the graphs and calculators. To allow the custom classes to be used in Python
with MediaPipe, you may extend the Packet API for a new data type in the
following steps:
@@ -229,7 +234,7 @@ three stages: initialization and setup, graph run, and graph shutdown.
output_packets.append(mp.packet_getter.get_str(packet)))
```
Option 2. Initialize a CalculatorGraph with with a binary protobuf file, and
Option 2. Initialize a CalculatorGraph with a binary protobuf file, and
observe the output stream(s).
```python
+9 -2
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/getting_started/troubleshooting
title: Troubleshooting
parent: Getting Started
nav_order: 10
@@ -12,6 +13,12 @@ nav_order: 10
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
## Missing Python binary path
The error message:
@@ -65,7 +72,7 @@ WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/gith
```
usually indicates that Bazel fails to download necessary dependency repositories
that MediaPipe needs. MedaiPipe has several dependency repositories that are
that MediaPipe needs. MediaPipe has several dependency repositories that are
hosted by Google sites. In some regions, you may need to set up a network proxy
or use a VPN to access those resources. You may also need to append
`--host_jvm_args "-DsocksProxyHost=<ip address> -DsocksProxyPort=<port number>"`
+16
View File
@@ -6,6 +6,20 @@ nav_order: 1
![MediaPipe](https://mediapipe.dev/images/mediapipe_small.png)
----
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
*This notice and web page will be removed on June 1, 2023.*
----
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
--------------------------------------------------------------------------------
## Live ML anywhere
@@ -19,6 +33,8 @@ ML solutions for live and streaming media.
![ready_to_use.png](https://mediapipe.dev/images/ready_to_use_small.png) | ![open_source.png](https://mediapipe.dev/images/open_source_small.png)
***Ready-to-use solutions***: *Cutting-edge ML solutions demonstrating full power of the framework* | ***Free and open source***: *Framework and solutions both under Apache 2.0, fully extensible and customizable*
----
## ML solutions in MediaPipe
Face Detection | Face Mesh | Iris | Hands | Pose | Holistic
+1 -1
View File
@@ -1,3 +1,3 @@
MediaPipe
=====================================
Please see https://docs.mediapipe.dev.
Please see https://developers.google.com/mediapipe/
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: AutoFlip (Saliency-aware Video Cropping)
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 14
---
@@ -18,6 +19,14 @@ nav_order: 14
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
AutoFlip is an automatic video cropping pipeline built on top of MediaPipe. This
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: Box Tracking
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 10
---
@@ -18,6 +19,14 @@ nav_order: 10
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe Box Tracking has been powering real-time tracking in
+35 -6
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/face_detector/
title: Face Detection
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 1
---
@@ -18,6 +19,14 @@ nav_order: 1
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe Face Detection is an ultrafast face detection solution that comes with
@@ -54,6 +63,25 @@ used for its improved inference speed. Please refer to the
[model cards](./models.md#face_detection) for details. Default to `0` if not
specified.
Note: Not available for JavaScript (use "model" instead).
#### model
A string value to indicate which model should be used. Use "short" to
select a short-range model that works best for faces within 2 meters from the
camera, and "full" for a full-range model best for faces within 5 meters. For
the full-range option, a sparse model is used for its improved inference speed.
Please refer to the model cards for details. Default to empty string.
Note: Valid only for JavaScript solution.
#### selfie_mode
A boolean value to indicate whether to flip the images/video frames
horizontally or not. Default to `false`.
Note: Valid only for JavaScript solution.
#### min_detection_confidence
Minimum confidence value (`[0.0, 1.0]`) from the face detection model for the
@@ -146,9 +174,9 @@ Please first see general [introduction](../getting_started/javascript.md) on
MediaPipe in JavaScript, then learn more in the companion [web demo](#resources)
and the following usage example.
Supported configuration options:
* [modelSelection](#model_selection)
Supported face detection options:
* [selfieMode](#selfie_mode)
* [model](#model)
* [minDetectionConfidence](#min_detection_confidence)
```html
@@ -176,6 +204,7 @@ Supported configuration options:
const videoElement = document.getElementsByClassName('input_video')[0];
const canvasElement = document.getElementsByClassName('output_canvas')[0];
const canvasCtx = canvasElement.getContext('2d');
const drawingUtils = window;
function onResults(results) {
// Draw the overlays.
@@ -199,7 +228,7 @@ const faceDetection = new FaceDetection({locateFile: (file) => {
return `https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/${file}`;
}});
faceDetection.setOptions({
modelSelection: 0,
model: 'short',
minDetectionConfidence: 0.5
});
faceDetection.onResults(onResults);
+12 -3
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/face_landmarker/
title: Face Mesh
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 2
---
@@ -18,6 +19,14 @@ nav_order: 2
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe Face Mesh is a solution that estimates 468 3D face landmarks in
@@ -133,7 +142,7 @@ about the model in this [paper](https://arxiv.org/abs/2006.10962).
The [Face Landmark Model](#face-landmark-model) performs a single-camera face landmark
detection in the screen coordinate space: the X- and Y- coordinates are
normalized screen coordinates, while the Z coordinate is relative and is scaled
as the X coodinate under the
as the X coordinate under the
[weak perspective projection camera model](https://en.wikipedia.org/wiki/3D_projection#Weak_perspective_projection).
This format is well-suited for some applications, however it does not directly
enable the full spectrum of augmented reality (AR) features like aligning a
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/image_segmenter/
title: Hair Segmentation
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 8
---
@@ -18,6 +19,14 @@ nav_order: 8
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of April 4, 2023, this solution was upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/image_segmenter/)
site.*
----
![hair_segmentation_android_gpu_gif](https://mediapipe.dev/images/mobile/hair_segmentation_android_gpu.gif)
## Example Apps
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/hand_landmarker
title: Hands
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 4
---
@@ -18,6 +19,14 @@ nav_order: 4
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution was upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/hand_landmarker)
site.*
----
## Overview
The ability to perceive the shape and motion of hands can be a vital component
+12 -3
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://github.com/google/mediapipe/blob/master/docs/solutions/holistic.md
title: Holistic
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 6
---
@@ -18,6 +19,14 @@ nav_order: 6
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
Live perception of simultaneous [human pose](./pose.md),
@@ -66,7 +75,7 @@ previous frame as a guide to the object region on the current one. However,
during fast movements, the tracker can lose the target, which requires the
detector to re-localize it in the image. MediaPipe Holistic uses
[pose](./pose.md) prediction (on every frame) as an additional ROI prior to
reduce the response time of the pipeline when reacting to fast movements. This
reducing the response time of the pipeline when reacting to fast movements. This
also enables the model to retain semantic consistency across the body and its
parts by preventing a mixup between left and right hands or body parts of one
person in the frame with another.
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: Instant Motion Tracking
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 11
---
@@ -18,6 +19,14 @@ nav_order: 11
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
Augmented Reality (AR) technology creates fun, engaging, and immersive user
+13 -4
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/face_landmarker/
title: Iris
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 3
---
@@ -18,6 +19,14 @@ nav_order: 3
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
A wide range of real-world applications, including computational photography
@@ -38,7 +47,7 @@ camera, in real-time, without the need for specialized hardware. Through use of
iris landmarks, the solution is also able to determine the metric distance
between the subject and the camera with relative error less than 10%. Note that
iris tracking does not infer the location at which people are looking, nor does
it provide any form of identity recognition. With the cross-platfrom capability
it provide any form of identity recognition. With the cross-platform capability
of the MediaPipe framework, MediaPipe Iris can run on most modern
[mobile phones](#mobile), [desktops/laptops](#desktop) and even on the
[web](#web).
@@ -99,7 +108,7 @@ You can also find more details in this
### Iris Landmark Model
The iris model takes an image patch of the eye region and estimates both the eye
landmarks (along the eyelid) and iris landmarks (along ths iris contour). You
landmarks (along the eyelid) and iris landmarks (along this iris contour). You
can find more details in this [paper](https://arxiv.org/abs/2006.11341).
![iris_tracking_eye_and_iris_landmarks.png](https://mediapipe.dev/images/mobile/iris_tracking_eye_and_iris_landmarks.png) |
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: KNIFT (Template-based Feature Matching)
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 13
---
@@ -18,6 +19,14 @@ nav_order: 13
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe KNIFT is a template-based feature matching solution using KNIFT
+12 -3
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: Dataset Preparation with MediaSequence
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 15
---
@@ -18,6 +19,14 @@ nav_order: 15
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the new
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe is a useful and general framework for media processing that can
@@ -85,7 +94,7 @@ process new data sets, in the documentation of
MediaSequence uses SequenceExamples as the format of both inputs and
outputs. Annotations are encoded as inputs in a SequenceExample of metadata
that defines the labels and the path to the cooresponding video file. This
that defines the labels and the path to the corresponding video file. This
metadata is passed as input to the C++ `media_sequence_demo` binary, and the
output is a SequenceExample filled with images and annotations ready for
model training.
+17 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: Models and Model Cards
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 30
---
@@ -12,6 +13,18 @@ nav_order: 30
{:toc}
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for
[these MediaPipe Legacy Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
as of March 1, 2023. All other
[MediaPipe Legacy Solutions will be upgraded](https://developers.google.com/mediapipe/solutions/guide#legacy)
to a new MediaPipe Solution. The code repository and prebuilt binaries for all
MediaPipe Legacy Solutions will continue to be provided on an as-is basis.
We encourage you to check out the new MediaPipe Solutions at:
[https://developers.google.com/mediapipe/solutions](https://developers.google.com/mediapipe/solutions)*
----
### [Face Detection](https://google.github.io/mediapipe/solutions/face_detection)
* Short-range model (best for faces within 2 meters from the camera):
@@ -94,6 +107,8 @@ one over the other.
* [TFLite model](https://storage.googleapis.com/mediapipe-assets/ssdlite_object_detection.tflite)
* [TFLite model quantized for EdgeTPU/Coral](https://github.com/google/mediapipe/tree/master/mediapipe/examples/coral/models/object-detector-quantized_edgetpu.tflite)
* [TensorFlow model](https://storage.googleapis.com/mediapipe-assets/object_detection_saved_model/archive.zip)
* [Model information](https://storage.googleapis.com/mediapipe-assets/object_detection_saved_model/README.md)
### [Objectron](https://google.github.io/mediapipe/solutions/objectron)
+13 -4
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/object_detector/
title: Object Detection
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 9
---
@@ -18,6 +19,14 @@ nav_order: 9
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution was upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/object_detector/)
site.*
----
![object_detection_android_gpu.gif](https://mediapipe.dev/images/mobile/object_detection_android_gpu.gif)
## Example Apps
@@ -108,9 +117,9 @@ on how to build MediaPipe examples.
* With a TensorFlow Model
This uses the
[TensorFlow model](https://github.com/google/mediapipe/tree/master/mediapipe/models/object_detection_saved_model)
[TensorFlow model](https://storage.googleapis.com/mediapipe-assets/object_detection_saved_model/archive.zip)
( see also
[model info](https://github.com/google/mediapipe/tree/master/mediapipe/models/object_detection_saved_model/README.md)),
[model info](https://storage.googleapis.com/mediapipe-assets/object_detection_saved_model/README.md)),
and the pipeline is implemented in this
[graph](https://github.com/google/mediapipe/tree/master/mediapipe/graphs/object_detection/object_detection_mobile_cpu.pbtxt).
@@ -0,0 +1,89 @@
---
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/object_detector
title: Object Detection
parent: MediaPipe Legacy Solutions
nav_order: 9
---
# MediaPipe Object Detection
{: .no_toc }
<details close markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution was upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/object_detector)
site.*
----
### TensorFlow model
The model is trained on [MSCOCO 2014](http://cocodataset.org) dataset using [TensorFlow Object Detection API](https://github.com/tensorflow/models/tree/master/research/object_detection). It is a MobileNetV2-based SSD model with 0.5 depth multiplier. Detailed training configuration is in the provided `pipeline.config`. The model is a relatively compact model which has `0.171 mAP` to achieve real-time performance on mobile devices. You can compare it with other models from the [TensorFlow detection model zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1_detection_zoo.md).
### TFLite model
The TFLite model is converted from the TensorFlow above. The steps needed to convert the model are similar to [this tutorial](https://medium.com/tensorflow/training-and-serving-a-realtime-mobile-object-detector-in-30-minutes-with-cloud-tpus-b78971cf1193) with minor modifications. Assuming now we have a trained TensorFlow model which includes the checkpoint files and the training configuration file, for example the files provided in this repo:
* `model.ckpt.index`
* `model.ckpt.meta`
* `model.ckpt.data-00000-of-00001`
* `pipeline.config`
Make sure you have installed these [python libraries](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1.md). Then to get the frozen graph, run the `export_tflite_ssd_graph.py` script from the `models/research` directory with this command:
```bash
$ PATH_TO_MODEL=path/to/the/model
$ bazel run object_detection:export_tflite_ssd_graph -- \
--pipeline_config_path ${PATH_TO_MODEL}/pipeline.config \
--trained_checkpoint_prefix ${PATH_TO_MODEL}/model.ckpt \
--output_directory ${PATH_TO_MODEL} \
--add_postprocessing_op=False
```
The exported model contains two files:
* `tflite_graph.pb`
* `tflite_graph.pbtxt`
The difference between this step and the one in [the tutorial](https://medium.com/tensorflow/training-and-serving-a-realtime-mobile-object-detector-in-30-minutes-with-cloud-tpus-b78971cf1193) is that we set `add_postprocessing_op` to False. In MediaPipe, we have provided all the calculators needed for post-processing such that we can exclude the custom TFLite ops for post-processing in the original graph, e.g., non-maximum suppression. This enables the flexibility to integrate with different post-processing algorithms and implementations.
Optional: You can install and use the [graph tool](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms) to inspect the input/output of the exported model:
```bash
$ bazel run graph_transforms:summarize_graph -- \
--in_graph=${PATH_TO_MODEL}/tflite_graph.pb
```
You should be able to see the input image size of the model is 320x320 and the outputs of the model are:
* `raw_outputs/box_encodings`
* `raw_outputs/class_predictions`
The last step is to convert the model to TFLite. You can look at [this guide](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/r1/convert/cmdline_examples.md) for more detail. For this example, you just need to run:
```bash
$ tflite_convert -- \
--graph_def_file=${PATH_TO_MODEL}/tflite_graph.pb \
--output_file=${PATH_TO_MODEL}/model.tflite \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--inference_type=FLOAT \
--input_shapes=1,320,320,3 \
--input_arrays=normalized_input_image_tensor \
--output_arrays=raw_outputs/box_encodings,raw_outputs/class_predictions
```
Now you have the TFLite model `model.tflite` ready to use with MediaPipe Object Detection graphs. Please see the examples for more detail.
+13 -4
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: Objectron (3D Object Detection)
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 12
---
@@ -18,6 +19,14 @@ nav_order: 12
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
## Overview
MediaPipe Objectron is a mobile real-time 3D object detection solution for
@@ -170,7 +179,7 @@ and a
The detection subgraph performs ML inference only once every few frames to
reduce computation load, and decodes the output tensor to a FrameAnnotation that
contains nine keypoints: the 3D bounding box's center and its eight vertices.
The tracking subgraph runs every frame, using the box traker in
The tracking subgraph runs every frame, using the box tracker in
[MediaPipe Box Tracking](./box_tracking.md) to track the 2D box tightly
enclosing the projection of the 3D bounding box, and lifts the tracked 2D
keypoints to 3D with
@@ -613,7 +622,7 @@ z_ndc = 1 / Z
### Pixel Space
In this API we set upper-left coner of an image as the origin of pixel
In this API we set upper-left corner of an image as the origin of pixel
coordinate. One can convert from NDC to pixel space as follows:
```
+13 -3
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/pose_landmarker/
title: Pose
parent: Solutions
parent: MediaPipe Legacy Solutions
has_children: true
has_toc: false
nav_order: 5
@@ -20,6 +21,14 @@ nav_order: 5
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/pose_landmarker/)
site.*
----
## Overview
Human pose estimation from video plays a critical role in various applications
@@ -134,7 +143,7 @@ The landmark model in MediaPipe Pose predicts the location of 33 pose landmarks
:----------------------------------------------------------------------------------------------: |
*Fig 4. 33 pose landmarks.* |
Optionally, MediaPipe Pose can predicts a full-body
Optionally, MediaPipe Pose can predict a full-body
[segmentation mask](#segmentation_mask) represented as a two-class segmentation
(human or background).
@@ -259,6 +268,7 @@ Supported configuration options:
```python
import cv2
import mediapipe as mp
import numpy as np
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_pose = mp.solutions.pose
+11 -2
View File
@@ -1,8 +1,9 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/pose_landmarker/
title: Pose Classification
parent: Pose
grand_parent: Solutions
grand_parent: MediaPipe Legacy Solutions
nav_order: 1
---
@@ -19,6 +20,14 @@ nav_order: 1
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of March 1, 2023, this solution is planned to be upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/pose_landmarker/)
site.*
----
## Overview
One of the applications
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/vision/image_segmenter/
title: Selfie Segmentation
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 7
---
@@ -18,6 +19,14 @@ nav_order: 7
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
As of April 4, 2023, this solution was upgraded to a new MediaPipe
Solution. For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/vision/image_segmenter/)
site.*
----
## Overview
*Fig 1. Example of MediaPipe Selfie Segmentation.* |
+24 -2
View File
@@ -1,18 +1,40 @@
---
layout: default
title: Solutions
title: MediaPipe Legacy Solutions
nav_order: 3
has_children: true
has_toc: false
---
# Solutions
# MediaPipe Legacy Solutions
{: .no_toc }
1. TOC
{:toc}
---
**Attention:** *Thank you for your interest in MediaPipe Solutions. We have
ended support for
[these MediaPipe Legacy Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
as of March 1, 2023. All other
[MediaPipe Legacy Solutions will be upgraded](https://developers.google.com/mediapipe/solutions/guide#legacy)
to a new MediaPipe Solution. The
[code repository](https://github.com/google/mediapipe/tree/master/mediapipe)
and prebuilt binaries for all MediaPipe Legacy Solutions will continue to
be provided on an as-is basis. We encourage you to check out the new MediaPipe
Solutions at:
[https://developers.google.com/mediapipe/solutions](https://developers.google.com/mediapipe/solutions)*
*This notice and web page will be removed on June 1, 2023.*
----
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
----
MediaPipe offers open source cross-platform, customizable ML solutions for live
and streaming media.
+11 -2
View File
@@ -1,7 +1,8 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/solutions/guide#legacy
title: YouTube-8M Feature Extraction and Model Inference
parent: Solutions
parent: MediaPipe Legacy Solutions
nav_order: 16
---
@@ -18,6 +19,14 @@ nav_order: 16
</details>
---
**Attention:** *Thank you for your interest in MediaPipe Solutions.
We have ended support for this MediaPipe Legacy Solution as of March 1, 2023.
For more information, see the
[MediaPipe Solutions](https://developers.google.com/mediapipe/solutions/guide#legacy)
site.*
----
MediaPipe is a useful and general framework for media processing that can assist
with research, development, and deployment of ML models. This example focuses on
model development by demonstrating how to prepare training data and do model
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: Performance Benchmarking
parent: Tools
nav_order: 3
@@ -12,6 +13,12 @@ nav_order: 3
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
---
*Coming soon.*
Future mediapipe releases will include tools for visualizing and analysing the
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: Tools
nav_order: 4
has_children: true
@@ -11,3 +12,9 @@ has_children: true
1. TOC
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/
title: Tracing and Profiling
parent: Tools
nav_order: 2
@@ -12,6 +13,12 @@ nav_order: 2
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
----
The MediaPipe framework includes a built-in tracer and profiler. The tracer
records various timing events related to packet processing, including the start
and end time of each Calculator::Process call. The tracer writes trace log files
+8 -1
View File
@@ -1,5 +1,6 @@
---
layout: default
layout: forward
target: https://developers.google.com/mediapipe/framework/tools/visualizer
title: Visualizer
parent: Tools
nav_order: 1
@@ -12,6 +13,12 @@ nav_order: 1
{:toc}
---
**Attention:** *Thanks for your interest in MediaPipe! We have moved to
[https://developers.google.com/mediapipe](https://developers.google.com/mediapipe)
as the primary developer documentation site for MediaPipe as of April 3, 2023.*
---
To help users understand the structure of their calculator graphs and to
understand the overall behavior of their machine learning inference pipelines,
we have built the [MediaPipe Visualizer](https://viz.mediapipe.dev/)
@@ -26,10 +26,11 @@
namespace mediapipe {
namespace {
static bool SafeMultiply(int x, int y, int* result) {
static_assert(sizeof(int64) >= 2 * sizeof(int),
static_assert(sizeof(int64_t) >= 2 * sizeof(int),
"Unable to detect overflow after multiplication");
const int64 big = static_cast<int64>(x) * static_cast<int64>(y);
if (big > static_cast<int64>(INT_MIN) && big < static_cast<int64>(INT_MAX)) {
const int64_t big = static_cast<int64_t>(x) * static_cast<int64_t>(y);
if (big > static_cast<int64_t>(INT_MIN) &&
big < static_cast<int64_t>(INT_MAX)) {
if (result != nullptr) *result = static_cast<int>(big);
return true;
} else {
@@ -182,12 +182,12 @@ class SpectrogramCalculator : public CalculatorBase {
int frame_duration_samples_;
int frame_overlap_samples_;
// How many samples we've been passed, used for checking input time stamps.
int64 cumulative_input_samples_;
int64_t cumulative_input_samples_;
// How many frames we've emitted, used for calculating output time stamps.
int64 cumulative_completed_frames_;
int64_t cumulative_completed_frames_;
// How many frames were emitted last, used for estimating the timestamp on
// Close when use_local_timestamp_ is true;
int64 last_completed_frames_;
int64_t last_completed_frames_;
Timestamp initial_input_timestamp_;
int num_input_channels_;
// How many frequency bins we emit (=N_FFT/2 + 1).
@@ -92,8 +92,8 @@ class SpectrogramCalculatorTest
.cos()
.transpose();
}
int64 input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
int64_t input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
AppendInputPacket(packet_data, input_timestamp);
total_num_input_samples += packet_size_samples;
}
@@ -116,8 +116,8 @@ class SpectrogramCalculatorTest
double packet_start_time_seconds =
kInitialTimestampOffsetMicroseconds * 1e-6 +
total_num_input_samples / input_sample_rate_;
int64 input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
int64_t input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
std::unique_ptr<Matrix> impulse(
new Matrix(Matrix::Zero(1, packet_sizes_samples[i])));
(*impulse)(0, impulse_offsets_samples[i]) = 1.0;
@@ -157,8 +157,8 @@ class SpectrogramCalculatorTest
.cos()
.transpose();
}
int64 input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
int64_t input_timestamp = round(packet_start_time_seconds *
Timestamp::kTimestampUnitsPerSecond);
AppendInputPacket(packet_data, input_timestamp);
total_num_input_samples += packet_size_samples;
}
@@ -218,7 +218,7 @@ class SpectrogramCalculatorTest
const double expected_timestamp_seconds =
packet_timestamp_offset_seconds +
cumulative_output_frames * frame_step_seconds;
const int64 expected_timestamp_ticks =
const int64_t expected_timestamp_ticks =
expected_timestamp_seconds * Timestamp::kTimestampUnitsPerSecond;
EXPECT_EQ(expected_timestamp_ticks, packet.Timestamp().Value());
// Accept the timestamp of the first packet as the baseline for checking
@@ -54,7 +54,8 @@ TEST_F(StabilizedLogCalculatorTest, BasicOperation) {
std::vector<Matrix> input_data_matrices;
for (int input_packet = 0; input_packet < kNumPackets; ++input_packet) {
const int64 timestamp = input_packet * Timestamp::kTimestampUnitsPerSecond;
const int64_t timestamp =
input_packet * Timestamp::kTimestampUnitsPerSecond;
Matrix input_data_matrix =
Matrix::Random(kNumChannels, kNumSamples).array().abs();
input_data_matrices.push_back(input_data_matrix);
@@ -80,7 +81,8 @@ TEST_F(StabilizedLogCalculatorTest, OutputScaleWorks) {
std::vector<Matrix> input_data_matrices;
for (int input_packet = 0; input_packet < kNumPackets; ++input_packet) {
const int64 timestamp = input_packet * Timestamp::kTimestampUnitsPerSecond;
const int64_t timestamp =
input_packet * Timestamp::kTimestampUnitsPerSecond;
Matrix input_data_matrix =
Matrix::Random(kNumChannels, kNumSamples).array().abs();
input_data_matrices.push_back(input_data_matrix);
@@ -109,7 +109,7 @@ class TimeSeriesFramerCalculator : public CalculatorBase {
// Returns the timestamp of a sample on a base, which is usually the time
// stamp of a packet.
Timestamp CurrentSampleTimestamp(const Timestamp& timestamp_base,
int64 number_of_samples) {
int64_t number_of_samples) {
return timestamp_base + round(number_of_samples / sample_rate_ *
Timestamp::kTimestampUnitsPerSecond);
}
@@ -118,10 +118,10 @@ class TimeSeriesFramerCalculator : public CalculatorBase {
// emitted.
int next_frame_step_samples() const {
// All numbers are in input samples.
const int64 current_output_frame_start = static_cast<int64>(
const int64_t current_output_frame_start = static_cast<int64_t>(
round(cumulative_output_frames_ * average_frame_step_samples_));
CHECK_EQ(current_output_frame_start, cumulative_completed_samples_);
const int64 next_output_frame_start = static_cast<int64>(
const int64_t next_output_frame_start = static_cast<int64_t>(
round((cumulative_output_frames_ + 1) * average_frame_step_samples_));
return next_output_frame_start - current_output_frame_start;
}
@@ -134,11 +134,11 @@ class TimeSeriesFramerCalculator : public CalculatorBase {
// emulate_fractional_frame_overlap is true.
double average_frame_step_samples_;
int samples_still_to_drop_;
int64 cumulative_output_frames_;
int64_t cumulative_output_frames_;
// "Completed" samples are samples that are no longer needed because
// the framer has completely stepped past them (taking into account
// any overlap).
int64 cumulative_completed_samples_;
int64_t cumulative_completed_samples_;
Timestamp initial_input_timestamp_;
// The current timestamp is updated along with the incoming packets.
Timestamp current_timestamp_;
@@ -49,7 +49,7 @@ class TimeSeriesFramerCalculatorTest
// Returns a float value with the channel and timestamp separated by
// an order of magnitude, for easy parsing by humans.
float TestValue(int64 timestamp_in_microseconds, int channel) {
float TestValue(int64_t timestamp_in_microseconds, int channel) {
return timestamp_in_microseconds + channel / 10.0;
}
@@ -59,7 +59,7 @@ class TimeSeriesFramerCalculatorTest
auto matrix = new Matrix(num_channels, num_samples);
for (int c = 0; c < num_channels; ++c) {
for (int i = 0; i < num_samples; ++i) {
int64 timestamp = time_series_util::SecondsToSamples(
int64_t timestamp = time_series_util::SecondsToSamples(
starting_timestamp_seconds + i / input_sample_rate_,
Timestamp::kTimestampUnitsPerSecond);
(*matrix)(c, i) = TestValue(timestamp, c);
@@ -429,7 +429,7 @@ class TimeSeriesFramerCalculatorTimestampingTest
num_full_packets -= 1;
}
int64 num_samples = 0;
int64_t num_samples = 0;
for (int packet_num = 0; packet_num < num_full_packets; ++packet_num) {
const Packet& packet = output().packets[packet_num];
num_samples += FrameDurationSamples();
+13 -5
View File
@@ -117,6 +117,7 @@ mediapipe_proto_library(
"//mediapipe/framework:calculator_proto",
"//mediapipe/framework/formats:classification_proto",
"//mediapipe/framework/formats:landmark_proto",
"//mediapipe/framework/formats:time_series_header_proto",
],
)
@@ -197,6 +198,7 @@ cc_library(
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:matrix",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/formats:tensor",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
@@ -216,9 +218,11 @@ cc_library(
"//mediapipe/framework:collection_item_id",
"//mediapipe/framework/formats:classification_cc_proto",
"//mediapipe/framework/formats:detection_cc_proto",
"//mediapipe/framework/formats:image",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:matrix",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/formats:tensor",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
@@ -235,10 +239,12 @@ cc_test(
":begin_loop_calculator",
":end_loop_calculator",
":gate_calculator",
":pass_through_calculator",
"//mediapipe/framework:calculator_context",
"//mediapipe/framework:calculator_contract",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework:packet",
"//mediapipe/framework/formats:tensor",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:parse_text_proto",
@@ -277,6 +283,7 @@ cc_library(
}),
deps = [
":concatenate_vector_calculator_cc_proto",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/api2:node",
"//mediapipe/framework/api2:port",
"//mediapipe/framework/formats:classification_cc_proto",
@@ -285,7 +292,6 @@ cc_library(
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
"//mediapipe/framework:calculator_framework",
"//mediapipe/util:render_data_cc_proto",
"@org_tensorflow//tensorflow/lite:framework",
] + select({
@@ -895,12 +901,12 @@ cc_library(
}),
deps = [
":split_vector_calculator_cc_proto",
"//mediapipe/framework/formats:detection_cc_proto",
"//mediapipe/framework/formats:classification_cc_proto",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework/formats:classification_cc_proto",
"//mediapipe/framework/formats:detection_cc_proto",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:matrix",
"//mediapipe/framework/formats:rect_cc_proto",
"//mediapipe/framework/formats:tensor",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
@@ -1158,6 +1164,7 @@ cc_library(
"//mediapipe/framework:collection_item_id",
"//mediapipe/framework/formats:classification_cc_proto",
"//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:time_series_header_cc_proto",
"//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check",
"//mediapipe/framework/port:status",
@@ -1329,6 +1336,7 @@ cc_library(
hdrs = ["merge_to_vector_calculator.h"],
deps = [
"//mediapipe/framework:calculator_framework",
"//mediapipe/framework:packet",
"//mediapipe/framework/api2:node",
"//mediapipe/framework/api2:port",
"//mediapipe/framework/formats:detection_cc_proto",
@@ -20,6 +20,7 @@
#include "mediapipe/calculators/core/end_loop_calculator.h"
#include "mediapipe/framework/calculator_contract.h"
#include "mediapipe/framework/calculator_framework.h"
#include "mediapipe/framework/formats/tensor.h"
#include "mediapipe/framework/packet.h"
#include "mediapipe/framework/port/gmock.h"
#include "mediapipe/framework/port/gtest.h"
@@ -444,5 +445,67 @@ TEST_F(BeginEndLoopCalculatorGraphWithClonedInputsTest, MultipleVectors) {
PacketOfIntsEq(input_timestamp2, std::vector<int>{6, 9})));
}
absl::Status InitBeginEndTensorLoopTestGraph(
CalculatorGraph& graph, std::vector<Packet>& output_packets) {
auto graph_config = ParseTextProtoOrDie<CalculatorGraphConfig>(
R"pb(
num_threads: 4
input_stream: "tensors"
node {
calculator: "BeginLoopTensorCalculator"
input_stream: "ITERABLE:tensors"
output_stream: "ITEM:tensor"
output_stream: "BATCH_END:timestamp"
}
node {
calculator: "PassThroughCalculator"
input_stream: "tensor"
output_stream: "passed_tensor"
}
node {
calculator: "EndLoopTensorCalculator"
input_stream: "ITEM:passed_tensor"
input_stream: "BATCH_END:timestamp"
output_stream: "ITERABLE:output_tensors"
}
)pb");
tool::AddVectorSink("output_tensors", &graph_config, &output_packets);
MP_RETURN_IF_ERROR(graph.Initialize(graph_config));
return graph.StartRun({});
}
TEST(BeginEndTensorLoopCalculatorGraphTest, SingleNonEmptyVector) {
// Initialize the graph.
CalculatorGraph graph;
std::vector<Packet> output_packets;
MP_ASSERT_OK(InitBeginEndTensorLoopTestGraph(graph, output_packets));
// Prepare the inputs and run.
Timestamp input_timestamp = Timestamp(0);
std::vector<mediapipe::Tensor> tensors;
for (int i = 0; i < 4; i++) {
tensors.emplace_back(Tensor::ElementType::kFloat32,
Tensor::Shape{4, 3, 2, 1});
}
Packet vector_packet =
MakePacket<std::vector<mediapipe::Tensor>>(std::move(tensors));
MP_ASSERT_OK(graph.AddPacketToInputStream(
"tensors", std::move(vector_packet).At(input_timestamp)));
MP_ASSERT_OK(graph.WaitUntilIdle());
// Verify the output packet.
EXPECT_EQ(output_packets.size(), 1);
const std::vector<Tensor>& output_tensors =
output_packets[0].Get<std::vector<Tensor>>();
EXPECT_EQ(output_tensors.size(), 4);
for (int i = 0; i < output_tensors.size(); i++) {
EXPECT_THAT(output_tensors[i].shape().dims,
testing::ElementsAre(4, 3, 2, 1));
}
MP_ASSERT_OK(graph.CloseAllPacketSources());
MP_ASSERT_OK(graph.WaitUntilDone());
}
} // namespace
} // namespace mediapipe
@@ -20,6 +20,7 @@
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/formats/matrix.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/tensor.h"
namespace mediapipe {
@@ -55,4 +56,8 @@ REGISTER_CALCULATOR(BeginLoopMatrixVectorCalculator);
typedef BeginLoopCalculator<std::vector<uint64_t>> BeginLoopUint64tCalculator;
REGISTER_CALCULATOR(BeginLoopUint64tCalculator);
// A calculator to process std::vector<mediapipe::Tensor>.
typedef BeginLoopCalculator<std::vector<Tensor>> BeginLoopTensorCalculator;
REGISTER_CALCULATOR(BeginLoopTensorCalculator);
} // namespace mediapipe
@@ -15,7 +15,6 @@
#ifndef MEDIAPIPE_CALCULATORS_CORE_BEGIN_LOOP_CALCULATOR_H_
#define MEDIAPIPE_CALCULATORS_CORE_BEGIN_LOOP_CALCULATOR_H_
#include "absl/memory/memory.h"
#include "mediapipe/framework/calculator_context.h"
#include "mediapipe/framework/calculator_contract.h"
#include "mediapipe/framework/calculator_framework.h"
@@ -24,6 +23,7 @@
#include "mediapipe/framework/port/integral_types.h"
#include "mediapipe/framework/port/ret_check.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/port/status_macros.h"
namespace mediapipe {
@@ -49,7 +49,7 @@ namespace mediapipe {
// calculator: "EndLoopWithOutputCalculator"
// input_stream: "ITEM:output_of_loop_body" # ItemU @loop_internal_ts
// input_stream: "BATCH_END:ext_ts" # Timestamp @loop_internal_ts
// output_stream: "OUTPUT:aggregated_result" # IterableU @ext_ts
// output_stream: "ITERABLE:aggregated_result" # IterableU @ext_ts
// }
//
// Input streams tagged with "CLONE" are cloned to the corresponding output
@@ -112,13 +112,38 @@ class BeginLoopCalculator : public CalculatorBase {
absl::Status Process(CalculatorContext* cc) final {
Timestamp last_timestamp = loop_internal_timestamp_;
if (!cc->Inputs().Tag("ITERABLE").IsEmpty()) {
const IterableT& collection =
cc->Inputs().Tag("ITERABLE").template Get<IterableT>();
for (const auto& item : collection) {
cc->Outputs().Tag("ITEM").AddPacket(
MakePacket<ItemT>(item).At(loop_internal_timestamp_));
ForwardClonePackets(cc, loop_internal_timestamp_);
++loop_internal_timestamp_;
// Try to consume the ITERABLE packet if possible to obtain the ownership
// and emit the item packets by moving them.
// If the ITERABLE packet is not consumable, then try to copy each item
// instead. If the ITEM type is not copy constructible, an error will be
// returned.
auto iterable_ptr_or =
cc->Inputs().Tag("ITERABLE").Value().Consume<IterableT>();
if (iterable_ptr_or.ok()) {
for (auto& item : *iterable_ptr_or.value()) {
Packet item_packet = MakePacket<ItemT>(std::move(item));
cc->Outputs().Tag("ITEM").AddPacket(
item_packet.At(loop_internal_timestamp_));
ForwardClonePackets(cc, loop_internal_timestamp_);
++loop_internal_timestamp_;
}
} else {
if constexpr (std::is_copy_constructible<ItemT>()) {
const IterableT& collection =
cc->Inputs().Tag("ITERABLE").template Get<IterableT>();
for (const auto& item : collection) {
cc->Outputs().Tag("ITEM").AddPacket(
MakePacket<ItemT>(item).At(loop_internal_timestamp_));
ForwardClonePackets(cc, loop_internal_timestamp_);
++loop_internal_timestamp_;
}
} else {
return absl::InternalError(
"The element type is not copiable. Consider making the "
"BeginLoopCalculator the sole owner of the input packet so that "
"the "
"items can be consumed and moved.");
}
}
}
@@ -138,7 +163,6 @@ class BeginLoopCalculator : public CalculatorBase {
.Tag("BATCH_END")
.AddPacket(MakePacket<Timestamp>(cc->InputTimestamp())
.At(Timestamp(loop_internal_timestamp_ - 1)));
return absl::OkStatus();
}
@@ -30,7 +30,7 @@ namespace mediapipe {
typedef ClipVectorSizeCalculator<int> TestClipIntVectorSizeCalculator;
REGISTER_CALCULATOR(TestClipIntVectorSizeCalculator);
void AddInputVector(const std::vector<int>& input, int64 timestamp,
void AddInputVector(const std::vector<int>& input, int64_t timestamp,
CalculatorRunner* runner) {
runner->MutableInputs()->Index(0).packets.push_back(
MakePacket<std::vector<int>>(input).At(Timestamp(timestamp)));
@@ -63,7 +63,7 @@ void ValidateCombinedLandmarks(
void AddInputLandmarkLists(
const std::vector<NormalizedLandmarkList>& input_landmarks_vec,
int64 timestamp, CalculatorRunner* runner) {
int64_t timestamp, CalculatorRunner* runner) {
for (int i = 0; i < input_landmarks_vec.size(); ++i) {
runner->MutableInputs()->Index(i).packets.push_back(
MakePacket<NormalizedLandmarkList>(input_landmarks_vec[i])
@@ -73,7 +73,7 @@ void AddInputLandmarkLists(
void AddInputClassificationLists(
const std::vector<ClassificationList>& input_classifications_vec,
int64 timestamp, CalculatorRunner* runner) {
int64_t timestamp, CalculatorRunner* runner) {
for (int i = 0; i < input_classifications_vec.size(); ++i) {
runner->MutableInputs()->Index(i).packets.push_back(
MakePacket<ClassificationList>(input_classifications_vec[i])
@@ -46,10 +46,10 @@ MEDIAPIPE_REGISTER_NODE(ConcatenateFloatVectorCalculator);
// input_stream: "int32_vector_2"
// output_stream: "concatenated_int32_vector"
// }
typedef ConcatenateVectorCalculator<int32> ConcatenateInt32VectorCalculator;
typedef ConcatenateVectorCalculator<int32_t> ConcatenateInt32VectorCalculator;
MEDIAPIPE_REGISTER_NODE(ConcatenateInt32VectorCalculator);
typedef ConcatenateVectorCalculator<uint64> ConcatenateUInt64VectorCalculator;
typedef ConcatenateVectorCalculator<uint64_t> ConcatenateUInt64VectorCalculator;
MEDIAPIPE_REGISTER_NODE(ConcatenateUInt64VectorCalculator);
typedef ConcatenateVectorCalculator<bool> ConcatenateBoolVectorCalculator;
@@ -30,26 +30,26 @@ namespace mediapipe {
typedef ConcatenateVectorCalculator<int> TestConcatenateIntVectorCalculator;
MEDIAPIPE_REGISTER_NODE(TestConcatenateIntVectorCalculator);
void AddInputVector(int index, const std::vector<int>& input, int64 timestamp,
void AddInputVector(int index, const std::vector<int>& input, int64_t timestamp,
CalculatorRunner* runner) {
runner->MutableInputs()->Index(index).packets.push_back(
MakePacket<std::vector<int>>(input).At(Timestamp(timestamp)));
}
void AddInputVectors(const std::vector<std::vector<int>>& inputs,
int64 timestamp, CalculatorRunner* runner) {
int64_t timestamp, CalculatorRunner* runner) {
for (int i = 0; i < inputs.size(); ++i) {
AddInputVector(i, inputs[i], timestamp, runner);
}
}
void AddInputItem(int index, int input, int64 timestamp,
void AddInputItem(int index, int input, int64_t timestamp,
CalculatorRunner* runner) {
runner->MutableInputs()->Index(index).packets.push_back(
MakePacket<int>(input).At(Timestamp(timestamp)));
}
void AddInputItems(const std::vector<int>& inputs, int64 timestamp,
void AddInputItems(const std::vector<int>& inputs, int64_t timestamp,
CalculatorRunner* runner) {
for (int i = 0; i < inputs.size(); ++i) {
AddInputItem(i, inputs[i], timestamp, runner);
@@ -279,7 +279,7 @@ TEST(TestConcatenateIntVectorCalculatorTest, MixedVectorsAndItemsAnother) {
}
void AddInputVectors(const std::vector<std::vector<float>>& inputs,
int64 timestamp, CalculatorRunner* runner) {
int64_t timestamp, CalculatorRunner* runner) {
for (int i = 0; i < inputs.size(); ++i) {
runner->MutableInputs()->Index(i).packets.push_back(
MakePacket<std::vector<float>>(inputs[i]).At(Timestamp(timestamp)));
@@ -19,6 +19,7 @@
#include "mediapipe/framework/collection_item_id.h"
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/formats/time_series_header.pb.h"
#include "mediapipe/framework/port/canonical_errors.h"
#include "mediapipe/framework/port/integral_types.h"
#include "mediapipe/framework/port/ret_check.h"
@@ -84,6 +85,8 @@ class ConstantSidePacketCalculator : public CalculatorBase {
packet.Set<LandmarkList>();
} else if (packet_options.has_double_value()) {
packet.Set<double>();
} else if (packet_options.has_time_series_header_value()) {
packet.Set<TimeSeriesHeader>();
} else {
return absl::InvalidArgumentError(
"None of supported values were specified in options.");
@@ -118,6 +121,9 @@ class ConstantSidePacketCalculator : public CalculatorBase {
MakePacket<LandmarkList>(packet_options.landmark_list_value()));
} else if (packet_options.has_double_value()) {
packet.Set(MakePacket<double>(packet_options.double_value()));
} else if (packet_options.has_time_series_header_value()) {
packet.Set(MakePacket<TimeSeriesHeader>(
packet_options.time_series_header_value()));
} else {
return absl::InvalidArgumentError(
"None of supported values were specified in options.");
@@ -19,6 +19,7 @@ package mediapipe;
import "mediapipe/framework/calculator.proto";
import "mediapipe/framework/formats/classification.proto";
import "mediapipe/framework/formats/landmark.proto";
import "mediapipe/framework/formats/time_series_header.proto";
message ConstantSidePacketCalculatorOptions {
extend CalculatorOptions {
@@ -35,6 +36,7 @@ message ConstantSidePacketCalculatorOptions {
ClassificationList classification_list_value = 6;
LandmarkList landmark_list_value = 7;
double double_value = 9;
TimeSeriesHeader time_series_header_value = 10;
}
}
@@ -18,9 +18,11 @@
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/detection.pb.h"
#include "mediapipe/framework/formats/image.h"
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/formats/matrix.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/tensor.h"
#include "mediapipe/util/render_data.pb.h"
#include "tensorflow/lite/interpreter.h"
@@ -52,8 +54,9 @@ typedef EndLoopCalculator<std::vector<::mediapipe::ClassificationList>>
EndLoopClassificationListCalculator;
REGISTER_CALCULATOR(EndLoopClassificationListCalculator);
typedef EndLoopCalculator<std::vector<TfLiteTensor>> EndLoopTensorCalculator;
REGISTER_CALCULATOR(EndLoopTensorCalculator);
typedef EndLoopCalculator<std::vector<TfLiteTensor>>
EndLoopTfLiteTensorCalculator;
REGISTER_CALCULATOR(EndLoopTfLiteTensorCalculator);
typedef EndLoopCalculator<std::vector<::mediapipe::Detection>>
EndLoopDetectionCalculator;
@@ -62,4 +65,11 @@ REGISTER_CALCULATOR(EndLoopDetectionCalculator);
typedef EndLoopCalculator<std::vector<Matrix>> EndLoopMatrixCalculator;
REGISTER_CALCULATOR(EndLoopMatrixCalculator);
typedef EndLoopCalculator<std::vector<Tensor>> EndLoopTensorCalculator;
REGISTER_CALCULATOR(EndLoopTensorCalculator);
typedef EndLoopCalculator<std::vector<::mediapipe::Image>>
EndLoopImageCalculator;
REGISTER_CALCULATOR(EndLoopImageCalculator);
} // namespace mediapipe
@@ -15,6 +15,8 @@
#ifndef MEDIAPIPE_CALCULATORS_CORE_END_LOOP_CALCULATOR_H_
#define MEDIAPIPE_CALCULATORS_CORE_END_LOOP_CALCULATOR_H_
#include <type_traits>
#include "mediapipe/framework/calculator_context.h"
#include "mediapipe/framework/calculator_contract.h"
#include "mediapipe/framework/calculator_framework.h"
@@ -75,8 +77,23 @@ class EndLoopCalculator : public CalculatorBase {
if (!input_stream_collection_) {
input_stream_collection_.reset(new IterableT);
}
input_stream_collection_->push_back(
cc->Inputs().Tag("ITEM").template Get<ItemT>());
// Try to consume the item and move it into the collection. If the items
// are not consumable, then try to copy them instead. If the items are
// not copiable, then an error will be returned.
auto item_ptr_or = cc->Inputs().Tag("ITEM").Value().Consume<ItemT>();
if (item_ptr_or.ok()) {
input_stream_collection_->push_back(std::move(*item_ptr_or.value()));
} else {
if constexpr (std::is_copy_constructible_v<ItemT>) {
input_stream_collection_->push_back(
cc->Inputs().Tag("ITEM").template Get<ItemT>());
} else {
return absl::InternalError(
"The item type is not copiable. Consider making the "
"EndLoopCalculator the sole owner of the input packets so that "
"it can be moved instead of copying.");
}
}
}
if (!cc->Inputs().Tag("BATCH_END").Value().IsEmpty()) { // flush signal
@@ -35,7 +35,6 @@ message FlowLimiterCalculatorOptions {
optional int32 max_in_queue = 2 [default = 0];
// The maximum time in microseconds to wait for a frame to finish processing.
// The default value stops waiting after 1 sec.
// The value 0 specifies no timeout.
optional int64 in_flight_timeout = 3 [default = 1000000];
// The default value 0 specifies no timeout.
optional int64 in_flight_timeout = 3 [default = 0];
}
@@ -61,8 +61,8 @@ class AtomicSemaphore {
};
// Returns the timestamp values for a vector of Packets.
std::vector<int64> TimestampValues(const std::vector<Packet>& packets) {
std::vector<int64> result;
std::vector<int64_t> TimestampValues(const std::vector<Packet>& packets) {
std::vector<int64_t> result;
for (const Packet& packet : packets) {
result.push_back(packet.Timestamp().Value());
}
@@ -180,9 +180,9 @@ TEST_F(FlowLimiterCalculatorSemaphoreTest, FramesDropped) {
InitializeGraph(1);
MP_ASSERT_OK(graph_.StartRun({}));
auto send_packet = [this](const std::string& input_name, int64 n) {
auto send_packet = [this](const std::string& input_name, int64_t n) {
MP_EXPECT_OK(graph_.AddPacketToInputStream(
input_name, MakePacket<int64>(n).At(Timestamp(n))));
input_name, MakePacket<int64_t>(n).At(Timestamp(n))));
};
Packet allow_packet;
@@ -207,12 +207,12 @@ TEST_F(FlowLimiterCalculatorSemaphoreTest, FramesDropped) {
EXPECT_EQ(10, out_1_packets_.size());
// Timestamps have not been altered.
EXPECT_EQ(PacketValues<int64>(out_1_packets_),
EXPECT_EQ(PacketValues<int64_t>(out_1_packets_),
TimestampValues(out_1_packets_));
// Extra inputs on in_1 have been dropped.
EXPECT_EQ(TimestampValues(out_1_packets_),
(std::vector<int64>{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}));
(std::vector<int64_t>{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}));
}
// A calculator that sleeps during Process.
@@ -221,8 +221,8 @@ class SleepCalculator : public CalculatorBase {
static absl::Status GetContract(CalculatorContract* cc) {
cc->Inputs().Tag(kPacketTag).SetAny();
cc->Outputs().Tag(kPacketTag).SetSameAs(&cc->Inputs().Tag(kPacketTag));
cc->InputSidePackets().Tag(kSleepTimeTag).Set<int64>();
cc->InputSidePackets().Tag(kWarmupTimeTag).Set<int64>();
cc->InputSidePackets().Tag(kSleepTimeTag).Set<int64_t>();
cc->InputSidePackets().Tag(kWarmupTimeTag).Set<int64_t>();
cc->InputSidePackets().Tag(kClockTag).Set<mediapipe::Clock*>();
cc->SetTimestampOffset(0);
return absl::OkStatus();
@@ -237,8 +237,8 @@ class SleepCalculator : public CalculatorBase {
++packet_count;
absl::Duration sleep_time = absl::Microseconds(
packet_count == 1
? cc->InputSidePackets().Tag(kWarmupTimeTag).Get<int64>()
: cc->InputSidePackets().Tag(kSleepTimeTag).Get<int64>());
? cc->InputSidePackets().Tag(kWarmupTimeTag).Get<int64_t>()
: cc->InputSidePackets().Tag(kSleepTimeTag).Get<int64_t>());
clock_->Sleep(sleep_time);
cc->Outputs()
.Tag(kPacketTag)
@@ -375,8 +375,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedTimestamps) {
std::map<std::string, Packet> side_packets = {
{"limiter_options",
MakePacket<FlowLimiterCalculatorOptions>(limiter_options)},
{"warmup_time", MakePacket<int64>(22000)},
{"sleep_time", MakePacket<int64>(22000)},
{"warmup_time", MakePacket<int64_t>(22000)},
{"sleep_time", MakePacket<int64_t>(22000)},
{"drop_timesamps", MakePacket<bool>(false)},
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -447,8 +447,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedLost) {
std::map<std::string, Packet> side_packets = {
{"limiter_options",
MakePacket<FlowLimiterCalculatorOptions>(limiter_options)},
{"warmup_time", MakePacket<int64>(22000)},
{"sleep_time", MakePacket<int64>(22000)},
{"warmup_time", MakePacket<int64_t>(22000)},
{"sleep_time", MakePacket<int64_t>(22000)},
{"drop_timesamps", MakePacket<bool>(true)},
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -511,8 +511,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedDelayed) {
std::map<std::string, Packet> side_packets = {
{"limiter_options",
MakePacket<FlowLimiterCalculatorOptions>(limiter_options)},
{"warmup_time", MakePacket<int64>(500000)},
{"sleep_time", MakePacket<int64>(22000)},
{"warmup_time", MakePacket<int64_t>(500000)},
{"sleep_time", MakePacket<int64_t>(22000)},
{"drop_timesamps", MakePacket<bool>(false)},
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -606,8 +606,8 @@ TEST_F(FlowLimiterCalculatorTest, TwoInputStreams) {
std::map<std::string, Packet> side_packets = {
{"limiter_options",
MakePacket<FlowLimiterCalculatorOptions>(limiter_options)},
{"warmup_time", MakePacket<int64>(22000)},
{"sleep_time", MakePacket<int64>(22000)},
{"warmup_time", MakePacket<int64_t>(22000)},
{"sleep_time", MakePacket<int64_t>(22000)},
{"drop_timesamps", MakePacket<bool>(true)},
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -715,8 +715,8 @@ TEST_F(FlowLimiterCalculatorTest, ZeroQueue) {
std::map<std::string, Packet> side_packets = {
{"limiter_options",
MakePacket<FlowLimiterCalculatorOptions>(limiter_options)},
{"warmup_time", MakePacket<int64>(12000)},
{"sleep_time", MakePacket<int64>(12000)},
{"warmup_time", MakePacket<int64_t>(12000)},
{"sleep_time", MakePacket<int64_t>(12000)},
{"drop_timesamps", MakePacket<bool>(true)},
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -862,9 +862,9 @@ TEST_F(FlowLimiterCalculatorTest, AuxiliaryInputs) {
std::map<std::string, Packet> side_packets = {
// Fake processing lazy initialization time in microseconds.
{"warmup_time", MakePacket<int64>(22000)},
{"warmup_time", MakePacket<int64_t>(22000)},
// Fake processing duration in microseconds.
{"sleep_time", MakePacket<int64>(22000)},
{"sleep_time", MakePacket<int64_t>(22000)},
// The SimulationClock to count virtual elapsed time.
{"clock", MakePacket<mediapipe::Clock*>(clock_)},
};
@@ -125,7 +125,6 @@ class GateCalculator : public CalculatorBase {
RET_CHECK_OK(CheckAndInitAllowDisallowInputs(cc));
const int num_data_streams = cc->Inputs().NumEntries("");
RET_CHECK_GE(num_data_streams, 1);
RET_CHECK_EQ(cc->Outputs().NumEntries(""), num_data_streams)
<< "Number of data output streams must match with data input streams.";
@@ -52,6 +52,15 @@ class GateCalculatorTest : public ::testing::Test {
MP_ASSERT_OK(runner_->Run()) << "Calculator execution failed.";
}
void RunTimeStepWithoutDataStream(int64_t timestamp,
const std::string& control_tag,
bool control) {
runner_->MutableInputs()
->Tag(control_tag)
.packets.push_back(MakePacket<bool>(control).At(Timestamp(timestamp)));
MP_ASSERT_OK(runner_->Run()) << "Calculator execution failed.";
}
void SetRunner(const std::string& proto) {
runner_ = absl::make_unique<CalculatorRunner>(
ParseTextProtoOrDie<CalculatorGraphConfig::Node>(proto));
@@ -332,6 +341,35 @@ TEST_F(GateCalculatorTest, AllowWithStateChange) {
EXPECT_EQ(false, output[1].Get<bool>()); // Disallow.
}
TEST_F(GateCalculatorTest, AllowWithStateChangeNoDataStreams) {
SetRunner(R"(
calculator: "GateCalculator"
input_stream: "ALLOW:gating_stream"
output_stream: "STATE_CHANGE:state_changed"
)");
constexpr int64_t kTimestampValue0 = 42;
RunTimeStepWithoutDataStream(kTimestampValue0, "ALLOW", false);
constexpr int64_t kTimestampValue1 = 43;
RunTimeStepWithoutDataStream(kTimestampValue1, "ALLOW", true);
constexpr int64_t kTimestampValue2 = 44;
RunTimeStepWithoutDataStream(kTimestampValue2, "ALLOW", true);
constexpr int64_t kTimestampValue3 = 45;
RunTimeStepWithoutDataStream(kTimestampValue3, "ALLOW", false);
LOG(INFO) << "a";
const std::vector<Packet>& output =
runner()->Outputs().Get("STATE_CHANGE", 0).packets;
LOG(INFO) << "s";
ASSERT_EQ(2, output.size());
LOG(INFO) << "d";
EXPECT_EQ(kTimestampValue1, output[0].Timestamp().Value());
EXPECT_EQ(kTimestampValue3, output[1].Timestamp().Value());
LOG(INFO) << "f";
EXPECT_EQ(true, output[0].Get<bool>()); // Allow.
EXPECT_EQ(false, output[1].Get<bool>()); // Disallow.
LOG(INFO) << "g";
}
TEST_F(GateCalculatorTest, DisallowWithStateChange) {
SetRunner(R"(
calculator: "GateCalculator"
@@ -359,6 +397,31 @@ TEST_F(GateCalculatorTest, DisallowWithStateChange) {
EXPECT_EQ(false, output[1].Get<bool>()); // Disallow.
}
TEST_F(GateCalculatorTest, DisallowWithStateChangeNoDataStreams) {
SetRunner(R"(
calculator: "GateCalculator"
input_stream: "DISALLOW:gating_stream"
output_stream: "STATE_CHANGE:state_changed"
)");
constexpr int64_t kTimestampValue0 = 42;
RunTimeStepWithoutDataStream(kTimestampValue0, "DISALLOW", true);
constexpr int64_t kTimestampValue1 = 43;
RunTimeStepWithoutDataStream(kTimestampValue1, "DISALLOW", false);
constexpr int64_t kTimestampValue2 = 44;
RunTimeStepWithoutDataStream(kTimestampValue2, "DISALLOW", false);
constexpr int64_t kTimestampValue3 = 45;
RunTimeStepWithoutDataStream(kTimestampValue3, "DISALLOW", true);
const std::vector<Packet>& output =
runner()->Outputs().Get("STATE_CHANGE", 0).packets;
ASSERT_EQ(2, output.size());
EXPECT_EQ(kTimestampValue1, output[0].Timestamp().Value());
EXPECT_EQ(kTimestampValue3, output[1].Timestamp().Value());
EXPECT_EQ(true, output[0].Get<bool>()); // Allow.
EXPECT_EQ(false, output[1].Get<bool>()); // Disallow.
}
// Must not detect disallow value for first timestamp as a state change.
TEST_F(GateCalculatorTest, DisallowInitialNoStateTransition) {
SetRunner(R"(
@@ -94,17 +94,17 @@ class GraphProfileCalculatorTest : public ::testing::Test {
&graph_config_));
}
static Packet PacketAt(int64 ts) {
return Adopt(new int64(999)).At(Timestamp(ts));
static Packet PacketAt(int64_t ts) {
return Adopt(new int64_t(999)).At(Timestamp(ts));
}
static Packet None() { return Packet().At(Timestamp::OneOverPostStream()); }
static bool IsNone(const Packet& packet) {
return packet.Timestamp() == Timestamp::OneOverPostStream();
}
// Return the values of the timestamps of a vector of Packets.
static std::vector<int64> TimestampValues(
static std::vector<int64_t> TimestampValues(
const std::vector<Packet>& packets) {
std::vector<int64> result;
std::vector<int64_t> result;
for (const Packet& p : packets) {
result.push_back(p.Timestamp().Value());
}
@@ -191,17 +191,17 @@ class ImmediateMuxCalculatorTest : public ::testing::Test {
&graph_config_));
}
static Packet PacketAt(int64 ts) {
return Adopt(new int64(999)).At(Timestamp(ts));
static Packet PacketAt(int64_t ts) {
return Adopt(new int64_t(999)).At(Timestamp(ts));
}
static Packet None() { return Packet().At(Timestamp::OneOverPostStream()); }
static bool IsNone(const Packet& packet) {
return packet.Timestamp() == Timestamp::OneOverPostStream();
}
// Return the values of the timestamps of a vector of Packets.
static std::vector<int64> TimestampValues(
static std::vector<int64_t> TimestampValues(
const std::vector<Packet>& packets) {
std::vector<int64> result;
std::vector<int64_t> result;
for (const Packet& p : packets) {
result.push_back(p.Timestamp().Value());
}
@@ -48,7 +48,6 @@ class MergeToVectorCalculator : public Node {
}
absl::Status Process(CalculatorContext* cc) {
const int input_num = kIn(cc).Count();
std::vector<T> output_vector;
for (auto it = kIn(cc).begin(); it != kIn(cc).end(); it++) {
const auto& elem = *it;

Some files were not shown because too many files have changed in this diff Show More