Merge pull request #4904 from priankakariatyml:ios-image-segmenter-cocoapods-build

PiperOrigin-RevId: 578993411
This commit is contained in:
Copybara-Service 2023-11-02 15:24:59 -07:00
commit 1cc79001f4
2 changed files with 12 additions and 2 deletions

View File

@ -57,6 +57,7 @@ CALCULATORS_AND_GRAPHS = [
"//mediapipe/tasks/cc/vision/hand_landmarker:hand_landmarker_graph", "//mediapipe/tasks/cc/vision/hand_landmarker:hand_landmarker_graph",
"//mediapipe/tasks/cc/vision/gesture_recognizer:gesture_recognizer_graph", "//mediapipe/tasks/cc/vision/gesture_recognizer:gesture_recognizer_graph",
"//mediapipe/tasks/cc/vision/image_classifier:image_classifier_graph", "//mediapipe/tasks/cc/vision/image_classifier:image_classifier_graph",
"//mediapipe/tasks/cc/vision/image_segmenter:image_segmenter_graph",
"//mediapipe/tasks/cc/vision/object_detector:object_detector_graph", "//mediapipe/tasks/cc/vision/object_detector:object_detector_graph",
] ]
@ -83,6 +84,7 @@ strip_api_include_path_prefix(
"//mediapipe/tasks/ios/text/text_embedder:sources/MPPTextEmbedderResult.h", "//mediapipe/tasks/ios/text/text_embedder:sources/MPPTextEmbedderResult.h",
"//mediapipe/tasks/ios/vision/core:sources/MPPRunningMode.h", "//mediapipe/tasks/ios/vision/core:sources/MPPRunningMode.h",
"//mediapipe/tasks/ios/vision/core:sources/MPPImage.h", "//mediapipe/tasks/ios/vision/core:sources/MPPImage.h",
"//mediapipe/tasks/ios/vision/core:sources/MPPMask.h",
"//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetector.h", "//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetector.h",
"//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetectorOptions.h", "//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetectorOptions.h",
"//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetectorResult.h", "//mediapipe/tasks/ios/vision/face_detector:sources/MPPFaceDetectorResult.h",
@ -98,6 +100,9 @@ strip_api_include_path_prefix(
"//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifier.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/MPPImageClassifierOptions.h",
"//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifierResult.h", "//mediapipe/tasks/ios/vision/image_classifier:sources/MPPImageClassifierResult.h",
"//mediapipe/tasks/ios/vision/image_segmenter:sources/MPPImageSegmenter.h",
"//mediapipe/tasks/ios/vision/image_segmenter:sources/MPPImageSegmenterOptions.h",
"//mediapipe/tasks/ios/vision/image_segmenter:sources/MPPImageSegmenterResult.h",
"//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetector.h", "//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetector.h",
"//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetectorOptions.h", "//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetectorOptions.h",
"//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetectorResult.h", "//mediapipe/tasks/ios/vision/object_detector:sources/MPPObjectDetectorResult.h",
@ -178,6 +183,7 @@ apple_static_xcframework(
":MPPTaskOptions.h", ":MPPTaskOptions.h",
":MPPTaskResult.h", ":MPPTaskResult.h",
":MPPImage.h", ":MPPImage.h",
":MPPMask.h",
":MPPRunningMode.h", ":MPPRunningMode.h",
":MPPFaceDetector.h", ":MPPFaceDetector.h",
":MPPFaceDetectorOptions.h", ":MPPFaceDetectorOptions.h",
@ -188,6 +194,9 @@ apple_static_xcframework(
":MPPImageClassifier.h", ":MPPImageClassifier.h",
":MPPImageClassifierOptions.h", ":MPPImageClassifierOptions.h",
":MPPImageClassifierResult.h", ":MPPImageClassifierResult.h",
":MPPImageSegmenter.h",
":MPPImageSegmenterOptions.h",
":MPPImageSegmenterResult.h",
":MPPHandLandmarker.h", ":MPPHandLandmarker.h",
":MPPHandLandmarkerOptions.h", ":MPPHandLandmarkerOptions.h",
":MPPHandLandmarkerResult.h", ":MPPHandLandmarkerResult.h",
@ -204,6 +213,7 @@ apple_static_xcframework(
"//mediapipe/tasks/ios/vision/gesture_recognizer:MPPGestureRecognizer", "//mediapipe/tasks/ios/vision/gesture_recognizer:MPPGestureRecognizer",
"//mediapipe/tasks/ios/vision/hand_landmarker:MPPHandLandmarker", "//mediapipe/tasks/ios/vision/hand_landmarker:MPPHandLandmarker",
"//mediapipe/tasks/ios/vision/image_classifier:MPPImageClassifier", "//mediapipe/tasks/ios/vision/image_classifier:MPPImageClassifier",
"//mediapipe/tasks/ios/vision/image_segmenter:MPPImageSegmenter",
"//mediapipe/tasks/ios/vision/object_detector:MPPObjectDetector", "//mediapipe/tasks/ios/vision/object_detector:MPPObjectDetector",
], ],
) )

View File

@ -47,7 +47,7 @@ using ::mediapipe::Packet;
->PixelData() ->PixelData()
width:confidenceMask.width() width:confidenceMask.width()
height:confidenceMask.height() height:confidenceMask.height()
shouldCopy:shouldCopyMaskPacketData ? YES : NO]]; shouldCopy:shouldCopyMaskPacketData]];
} }
} }
@ -57,7 +57,7 @@ using ::mediapipe::Packet;
initWithUInt8Data:(UInt8 *)cppCategoryMask.GetImageFrameSharedPtr().get()->PixelData() initWithUInt8Data:(UInt8 *)cppCategoryMask.GetImageFrameSharedPtr().get()->PixelData()
width:cppCategoryMask.width() width:cppCategoryMask.width()
height:cppCategoryMask.height() height:cppCategoryMask.height()
shouldCopy:shouldCopyMaskPacketData ? YES : NO]; shouldCopy:shouldCopyMaskPacketData];
} }
if (qualityScoresPacket.ValidateAsType<std::vector<float>>().ok()) { if (qualityScoresPacket.ValidateAsType<std::vector<float>>().ok()) {