From 298578e10e95779ee3fc220dd2b9f9c0d2c128d9 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Wed, 30 Aug 2023 14:51:05 +0530 Subject: [PATCH 1/3] Added gesture recognizer and hand landmarker to iOS vision framework --- mediapipe/tasks/ios/BUILD | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mediapipe/tasks/ios/BUILD b/mediapipe/tasks/ios/BUILD index 14a409e72..8cb58f410 100644 --- a/mediapipe/tasks/ios/BUILD +++ b/mediapipe/tasks/ios/BUILD @@ -54,6 +54,8 @@ CALCULATORS_AND_GRAPHS = [ "//mediapipe/tasks/cc/text/text_embedder:text_embedder_graph", "//mediapipe/tasks/cc/vision/face_detector:face_detector_graph", "//mediapipe/tasks/cc/vision/face_landmarker:face_landmarker_graph", + "//mediapipe/tasks/cc/vision/hand_landmarker:hand_landmarker_graph", + "//mediapipe/tasks/cc/vision/gesture_recognizer:gesture_recognizer_graph", "//mediapipe/tasks/cc/vision/image_classifier:image_classifier_graph", "//mediapipe/tasks/cc/vision/object_detector:object_detector_graph", ] @@ -69,6 +71,7 @@ strip_api_include_path_prefix( "//mediapipe/tasks/ios/components/containers:sources/MPPConnection.h", "//mediapipe/tasks/ios/components/containers:sources/MPPDetection.h", "//mediapipe/tasks/ios/components/containers:sources/MPPLandmark.h", + "//mediapipe/tasks/ios/components/processors:sources/MPPClassifierOptions.h", "//mediapipe/tasks/ios/core:sources/MPPBaseOptions.h", "//mediapipe/tasks/ios/core:sources/MPPTaskOptions.h", "//mediapipe/tasks/ios/core:sources/MPPTaskResult.h", @@ -86,6 +89,12 @@ strip_api_include_path_prefix( "//mediapipe/tasks/ios/vision/face_landmarker:sources/MPPFaceLandmarker.h", "//mediapipe/tasks/ios/vision/face_landmarker:sources/MPPFaceLandmarkerOptions.h", "//mediapipe/tasks/ios/vision/face_landmarker:sources/MPPFaceLandmarkerResult.h", + "//mediapipe/tasks/ios/vision/hand_landmarker:sources/MPPHandLandmarker.h", + "//mediapipe/tasks/ios/vision/hand_landmarker:sources/MPPHandLandmarkerOptions.h", + "//mediapipe/tasks/ios/vision/hand_landmarker:sources/MPPHandLandmarkerResult.h", + "//mediapipe/tasks/ios/vision/gesture_recognizer:sources/MPPGestureRecognizer.h", + "//mediapipe/tasks/ios/vision/gesture_recognizer:sources/MPPGestureRecognizerOptions.h", + "//mediapipe/tasks/ios/vision/gesture_recognizer:sources/MPPGestureRecognizerResult.h", "//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifier.h", "//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifierOptions.h", "//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifierResult.h", @@ -161,6 +170,7 @@ apple_static_xcframework( ":MPPBaseOptions.h", ":MPPCategory.h", ":MPPClassificationResult.h", + ":MPPClassifierOptions", ":MPPDetection.h", ":MPPLandmark.h", ":MPPConnection.h", @@ -178,6 +188,12 @@ apple_static_xcframework( ":MPPImageClassifier.h", ":MPPImageClassifierOptions.h", ":MPPImageClassifierResult.h", + ":MPPHandLandmarker", + ":MPPHandLandmarkerOptions", + ":MPPHandLandmarkerResult", + ":MPPGestureRecognizer", + ":MPPGestureRecognizerOptions", + ":MPPGestureRecognizerResult", ":MPPObjectDetector.h", ":MPPObjectDetectorOptions.h", ":MPPObjectDetectorResult.h", @@ -185,6 +201,8 @@ apple_static_xcframework( deps = [ "//mediapipe/tasks/ios/vision/face_detector:MPPFaceDetector", "//mediapipe/tasks/ios/vision/face_landmarker:MPPFaceLandmarker", + "//mediapipe/tasks/ios/vision/hand_landmarker:MPPHandLandmarker", + "//mediapipe/tasks/ios/vision/gesture_recognizer:MPPGestureRecognizer", "//mediapipe/tasks/ios/vision/image_classifier:MPPImageClassifier", "//mediapipe/tasks/ios/vision/object_detector:MPPObjectDetector", ], From 763bc8c71c05d5663fce66ef01332346a01a058d Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Wed, 30 Aug 2023 16:27:52 +0530 Subject: [PATCH 2/3] Fixed typos --- mediapipe/tasks/ios/BUILD | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mediapipe/tasks/ios/BUILD b/mediapipe/tasks/ios/BUILD index 8cb58f410..5aff058bd 100644 --- a/mediapipe/tasks/ios/BUILD +++ b/mediapipe/tasks/ios/BUILD @@ -170,7 +170,7 @@ apple_static_xcframework( ":MPPBaseOptions.h", ":MPPCategory.h", ":MPPClassificationResult.h", - ":MPPClassifierOptions", + ":MPPClassifierOptions.h", ":MPPDetection.h", ":MPPLandmark.h", ":MPPConnection.h", @@ -188,12 +188,12 @@ apple_static_xcframework( ":MPPImageClassifier.h", ":MPPImageClassifierOptions.h", ":MPPImageClassifierResult.h", - ":MPPHandLandmarker", - ":MPPHandLandmarkerOptions", - ":MPPHandLandmarkerResult", - ":MPPGestureRecognizer", - ":MPPGestureRecognizerOptions", - ":MPPGestureRecognizerResult", + ":MPPHandLandmarker.h", + ":MPPHandLandmarkerOptions.h", + ":MPPHandLandmarkerResult.h", + ":MPPGestureRecognizer.h", + ":MPPGestureRecognizerOptions.h", + ":MPPGestureRecognizerResult.h", ":MPPObjectDetector.h", ":MPPObjectDetectorOptions.h", ":MPPObjectDetectorResult.h", From 3e90e8d4643d7a4596dc1fae106416eedd4690e4 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Wed, 30 Aug 2023 16:28:17 +0530 Subject: [PATCH 3/3] Fixed directory creation issues in build_ios_framework.sh --- mediapipe/tasks/ios/build_ios_framework.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mediapipe/tasks/ios/build_ios_framework.sh b/mediapipe/tasks/ios/build_ios_framework.sh index 1142f08af..b396620be 100755 --- a/mediapipe/tasks/ios/build_ios_framework.sh +++ b/mediapipe/tasks/ios/build_ios_framework.sh @@ -124,7 +124,7 @@ function build_ios_frameworks_and_libraries { function create_framework_archive { # Change to the Bazel iOS output directory. - pushd "${BAZEL_IOS_OUTDIR}" + pushd "${MPP_ROOT_DIR}" # Create the temporary directory for the given framework. local ARCHIVE_NAME="${FRAMEWORK_NAME}-${MPP_BUILD_VERSION}" @@ -165,9 +165,9 @@ function create_framework_archive { #----- (3) Move the framework to the destination ----- if [[ "${ARCHIVE_FRAMEWORK}" == true ]]; then - local TARGET_DIR="$(realpath "${FRAMEWORK_NAME}")" - # Create the framework archive directory. + mkdir -p "${FRAMEWORK_NAME}" + local TARGET_DIR="$(realpath "${FRAMEWORK_NAME}")" local FRAMEWORK_ARCHIVE_DIR if [[ "${IS_RELEASE_BUILD}" == true ]]; then @@ -178,7 +178,7 @@ function create_framework_archive { FRAMEWORK_ARCHIVE_DIR="${TARGET_DIR}/${MPP_BUILD_VERSION}" fi mkdir -p "${FRAMEWORK_ARCHIVE_DIR}" - + # Zip up the framework and move to the archive directory. pushd "${MPP_TMPDIR}" local MPP_ARCHIVE_FILE="${ARCHIVE_NAME}.tar.gz" @@ -186,8 +186,11 @@ function create_framework_archive { mv "${MPP_ARCHIVE_FILE}" "${FRAMEWORK_ARCHIVE_DIR}" popd - # Move the target directory to the Kokoro artifacts directory. - mv "${TARGET_DIR}" "$(realpath "${DEST_DIR}")"/ + # Move the target directory to the Kokoro artifacts directory and clean up + # the artifacts directory in the mediapipe root directory even if the + # move command fails. + mv "${TARGET_DIR}" "$(realpath "${DEST_DIR}")"/ || true + rm -rf "${TARGET_DIR}" else rsync -r "${MPP_TMPDIR}/" "$(realpath "${DEST_DIR}")/" fi