internal change

PiperOrigin-RevId: 491429214
This commit is contained in:
MediaPipe Team 2022-11-28 13:29:35 -08:00 committed by Copybara-Service
parent 153edc59a1
commit c48ca1f674
11 changed files with 82 additions and 74 deletions

View File

@ -49,8 +49,3 @@ cc_library(
"//mediapipe/tasks/cc/components/containers/proto:embeddings_cc_proto",
],
)
cc_library(
name = "landmark",
hdrs = ["landmark.h"],
)

View File

@ -54,6 +54,12 @@ cc_library(
],
)
cc_library(
name = "hand_landmark",
hdrs = ["hand_landmark.h"],
visibility = ["//visibility:public"],
)
cc_library(
name = "hand_landmarks_detector_graph",
srcs = ["hand_landmarks_detector_graph.cc"],

View File

@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef MEDIAPIPE_TASKS_CC_COMPONENTS_CONTAINERS_LANDMARK_H_
#define MEDIAPIPE_TASKS_CC_COMPONENTS_CONTAINERS_LANDMARK_H_
#ifndef MEDIAPIPE_TASKS_CC_VISION_HAND_LANDMARKER_HAND_LANDMARK_H_
#define MEDIAPIPE_TASKS_CC_VISION_HAND_LANDMARKER_HAND_LANDMARK_H_
namespace mediapipe::tasks::components::containers {
namespace mediapipe::tasks::vision::hand_landmarker {
// The 21 hand landmarks.
enum HandLandmark {
@ -43,6 +43,6 @@ enum HandLandmark {
PINKY_TIP = 20
};
} // namespace mediapipe::tasks::components::containers
} // namespace mediapipe::tasks::vision::hand_landmarker
#endif // MEDIAPIPE_TASKS_CC_COMPONENTS_CONTAINERS_LANDMARK_H_
#endif // MEDIAPIPE_TASKS_CC_VISION_HAND_LANDMARKER_HAND_LANDMARK_H_

View File

@ -74,18 +74,6 @@ android_library(
],
)
android_library(
name = "handlandmark",
srcs = ["HandLandmark.java"],
javacopts = [
"-Xep:AndroidJdkLibsChecker:OFF",
],
deps = [
"@maven//:androidx_annotation_annotation",
"@maven//:com_google_guava_guava",
],
)
android_library(
name = "landmark",
srcs = ["Landmark.java"],

View File

@ -145,6 +145,7 @@ android_library(
android_library(
name = "handlandmarker",
srcs = [
"handlandmarker/HandLandmark.java",
"handlandmarker/HandLandmarker.java",
"handlandmarker/HandLandmarkerResult.java",
],
@ -168,6 +169,7 @@ android_library(
"//mediapipe/tasks/java/com/google/mediapipe/tasks/components/containers:landmark",
"//mediapipe/tasks/java/com/google/mediapipe/tasks/core",
"//third_party:autovalue",
"@maven//:androidx_annotation_annotation",
"@maven//:com_google_guava_guava",
],
)

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.mediapipe.tasks.components.containers;
package com.google.mediapipe.tasks.vision.handlandmarker;
import androidx.annotation.IntDef;

View File

@ -14,7 +14,6 @@
"""Landmark data class."""
import dataclasses
import enum
from typing import Optional
from mediapipe.framework.formats import landmark_pb2
@ -121,28 +120,3 @@ class NormalizedLandmark:
z=pb2_obj.z,
visibility=pb2_obj.visibility,
presence=pb2_obj.presence)
class HandLandmark(enum.IntEnum):
"""The 21 hand landmarks."""
WRIST = 0
THUMB_CMC = 1
THUMB_MCP = 2
THUMB_IP = 3
THUMB_TIP = 4
INDEX_FINGER_MCP = 5
INDEX_FINGER_PIP = 6
INDEX_FINGER_DIP = 7
INDEX_FINGER_TIP = 8
MIDDLE_FINGER_MCP = 9
MIDDLE_FINGER_PIP = 10
MIDDLE_FINGER_DIP = 11
MIDDLE_FINGER_TIP = 12
RING_FINGER_MCP = 13
RING_FINGER_PIP = 14
RING_FINGER_DIP = 15
RING_FINGER_TIP = 16
PINKY_MCP = 17
PINKY_PIP = 18
PINKY_DIP = 19
PINKY_TIP = 20

View File

@ -14,6 +14,7 @@
"""MediaPipe hand landmarker task."""
import dataclasses
import enum
from typing import Callable, Mapping, Optional, List
from mediapipe.framework.formats import classification_pb2
@ -53,6 +54,31 @@ _TASK_GRAPH_NAME = 'mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph'
_MICRO_SECONDS_PER_MILLISECOND = 1000
class HandLandmark(enum.IntEnum):
"""The 21 hand landmarks."""
WRIST = 0
THUMB_CMC = 1
THUMB_MCP = 2
THUMB_IP = 3
THUMB_TIP = 4
INDEX_FINGER_MCP = 5
INDEX_FINGER_PIP = 6
INDEX_FINGER_DIP = 7
INDEX_FINGER_TIP = 8
MIDDLE_FINGER_MCP = 9
MIDDLE_FINGER_PIP = 10
MIDDLE_FINGER_DIP = 11
MIDDLE_FINGER_TIP = 12
RING_FINGER_MCP = 13
RING_FINGER_PIP = 14
RING_FINGER_DIP = 15
RING_FINGER_TIP = 16
PINKY_MCP = 17
PINKY_PIP = 18
PINKY_DIP = 19
PINKY_TIP = 20
@dataclasses.dataclass
class HandLandmarkerResult:
"""The hand landmarks result from HandLandmarker, where each vector element represents a single hand detected in the image.

View File

@ -33,28 +33,3 @@ export declare interface Landmark {
/** Whether this landmark is normalized with respect to the image size. */
normalized: boolean;
}
/** The 21 hand landmarks. */
export const enum HandLandmark {
WRIST = 0,
THUMB_CMC = 1,
THUMB_MCP = 2,
THUMB_IP = 3,
THUMB_TIP = 4,
INDEX_FINGER_MCP = 5,
INDEX_FINGER_PIP = 6,
INDEX_FINGER_DIP = 7,
INDEX_FINGER_TIP = 8,
MIDDLE_FINGER_MCP = 9,
MIDDLE_FINGER_PIP = 10,
MIDDLE_FINGER_DIP = 11,
MIDDLE_FINGER_TIP = 12,
RING_FINGER_MCP = 13,
RING_FINGER_PIP = 14,
RING_FINGER_DIP = 15,
RING_FINGER_TIP = 16,
PINKY_MCP = 17,
PINKY_PIP = 18,
PINKY_DIP = 19,
PINKY_TIP = 20
}

View File

@ -34,6 +34,7 @@ mediapipe_ts_library(
mediapipe_ts_declaration(
name = "hand_landmarker_types",
srcs = [
"hand_landmark.d.ts",
"hand_landmarker_options.d.ts",
"hand_landmarker_result.d.ts",
],

View File

@ -0,0 +1,41 @@
/**
* Copyright 2022 The MediaPipe Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* 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.
*/
/** The 21 hand landmarks. */
export const enum HandLandmark {
WRIST = 0,
THUMB_CMC = 1,
THUMB_MCP = 2,
THUMB_IP = 3,
THUMB_TIP = 4,
INDEX_FINGER_MCP = 5,
INDEX_FINGER_PIP = 6,
INDEX_FINGER_DIP = 7,
INDEX_FINGER_TIP = 8,
MIDDLE_FINGER_MCP = 9,
MIDDLE_FINGER_PIP = 10,
MIDDLE_FINGER_DIP = 11,
MIDDLE_FINGER_TIP = 12,
RING_FINGER_MCP = 13,
RING_FINGER_PIP = 14,
RING_FINGER_DIP = 15,
RING_FINGER_TIP = 16,
PINKY_MCP = 17,
PINKY_PIP = 18,
PINKY_DIP = 19,
PINKY_TIP = 20
}