Skip to content

Commit 85b1938

Browse files
schmidt-sebastiancopybara-github
authored andcommitted
Fixes iOS hand landmarker connections
PiperOrigin-RevId: 565442497
1 parent 124a4de commit 85b1938

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Diff for: mediapipe/tasks/ios/vision/hand_landmarker/sources/MPPHandLandmarker.h

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ typedef NS_ENUM(NSUInteger, MPPHandLandmark) {
3333

3434
MPPHandLandmarkThumbIP,
3535

36+
MPPHandLandmarkThumbTIP,
37+
3638
MPPHandLandmarkIndexFingerMCP,
3739

3840
MPPHandLandmarkIndexFingerPIP,
@@ -78,6 +80,9 @@ NS_SWIFT_NAME(HandLandmarker)
7880
/** The array of connections between the landmarks in the palm. */
7981
@property(class, nonatomic, readonly) NSArray<MPPConnection *> *handPalmConnections;
8082

83+
/** The array of connections between the landmarks in the thumb. */
84+
@property(class, nonatomic, readonly) NSArray<MPPConnection *> *handThumbConnections;
85+
8186
/** The array of connections between the landmarks in the index finger. */
8287
@property(class, nonatomic, readonly) NSArray<MPPConnection *> *handIndexFingerConnections;
8388

Diff for: mediapipe/tasks/ios/vision/hand_landmarker/sources/MPPHandLandmarker.mm

+4
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ - (BOOL)detectAsyncInImage:(MPPImage *)image
169169
return MPPHandPalmConnections;
170170
}
171171

172+
+ (NSArray<MPPConnection *> *)handThumbConnections {
173+
return MPPHandThumbConnections;
174+
}
175+
172176
+ (NSArray<MPPConnection *> *)handIndexFingerConnections {
173177
return MPPHandIndexFingerConnections;
174178
}

Diff for: mediapipe/tasks/ios/vision/hand_landmarker/sources/MPPHandLandmarksConnections.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ NSArray<MPPConnection *> *const MPPHandRingFingerConnections = @[
4444
];
4545

4646
NSArray<MPPConnection *> *const MPPHandPinkyConnections = @[
47-
[[MPPConnection alloc] initWithStart:16 end:17], [[MPPConnection alloc] initWithStart:17 end:18],
48-
[[MPPConnection alloc] initWithStart:18 end:19]
47+
[[MPPConnection alloc] initWithStart:17 end:18], [[MPPConnection alloc] initWithStart:18 end:19],
48+
[[MPPConnection alloc] initWithStart:19 end:20]
4949
];
5050

5151
NSArray<MPPConnection *> *const MPPHandConnections = [[[[[[NSArray

0 commit comments

Comments
 (0)