Users need to provide a custom {@link ResultGlRenderer} via {@link
+ * setSolutionResultRenderer(ResultGlRenderer)} for rendering MediaPipe solution results. Setting
+ * the latest render data by calling {@link #setRenderData(ImageSolutionResult)} before invoking
+ * {@link #requestRender}. By default, the solution renderer renders the input images. Call {@link
+ * #setRenderInputImage(boolean)} to explicitly set whether the input images should be rendered or
+ * not.
+ */
+public class SolutionGlSurfaceView Users can provide a custom {@link ResultGlRenderer} for rendering MediaPipe solution results.
+ * For setting the latest solution result, call {@link #setRenderData(ImageSolutionResult)}. By
+ * default, the renderer renders the input images. Call {@link #setRenderInputImage(boolean)} to
+ * explicitly set whether the input images should be rendered or not.
+ */
+public class SolutionGlSurfaceViewRenderer MediaPipe Hands processes a {@link TextureFrame} or a {@link Bitmap} and returns the hand
+ * landmarks and handedness (left v.s. right hand) of each detected hand. Please refer to
+ * https://solutions.mediapipe.dev/hands#android-solution-api for usage examples.
+ */
+public class Hands extends ImageSolutionBase {
+ private static final String TAG = "Hands";
+
+ private static final String NUM_HANDS = "num_hands";
+ private static final String SOLUTION_GRAPH_NAME = "hand_landmark_tracking_gpu_image.binarypb";
+ private static final String IMAGE_INPUT_STREAM = "image";
+ private static final ImmutableList mode: Whether to treat the input images as a batch of static and possibly unrelated images, or
+ * a video stream. See details in https://solutions.mediapipe.dev/hands#static_image_mode.
+ *
+ * maxNumHands: Maximum number of hands to detect. See details in
+ * https://solutions.mediapipe.dev/hands#max_num_hands.
+ *
+ * minDetectionConfidence: Minimum confidence value ([0.0, 1.0]) for hand detection to be
+ * considered successful. See details in
+ * https://solutions.mediapipe.dev/hands#min_detection_confidence.
+ *
+ * minTrackingConfidence: Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be
+ * considered tracked successfully. See details in
+ * https://solutions.mediapipe.dev/hands#min_tracking_confidence.
+ */
+@AutoValue
+public abstract class HandsOptions {
+
+ // TODO: Switch to use boolean variable.
+ public static final int STREAMING_MODE = 1;
+ public static final int STATIC_IMAGE_MODE = 2;
+
+ /**
+ * Indicates whether to treat the input images as a batch of static and possibly unrelated images,
+ * or a video stream.
+ */
+ @IntDef({STREAMING_MODE, STATIC_IMAGE_MODE})
+ public @interface Mode {}
+
+ @Mode
+ public abstract int mode();
+
+ public abstract int maxNumHands();
+
+ public abstract float minDetectionConfidence();
+
+ public abstract float minTrackingConfidence();
+
+ public static Builder builder() {
+ return new AutoValue_HandsOptions.Builder();
+ }
+
+ /** Builder for {@link HandsOptions}. */
+ @AutoValue.Builder
+ public abstract static class Builder {
+ public abstract Builder setMode(int value);
+
+ public abstract Builder setMaxNumHands(int value);
+
+ public abstract Builder setMinDetectionConfidence(float value);
+
+ public abstract Builder setMinTrackingConfidence(float value);
+
+ public abstract HandsOptions build();
+ }
+}
diff --git a/mediapipe/java/com/google/mediapipe/solutions/hands/HandsResult.java b/mediapipe/java/com/google/mediapipe/solutions/hands/HandsResult.java
new file mode 100644
index 00000000..8b31bae8
--- /dev/null
+++ b/mediapipe/java/com/google/mediapipe/solutions/hands/HandsResult.java
@@ -0,0 +1,81 @@
+// Copyright 2021 The MediaPipe Authors.
+//
+// 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.
+
+package com.google.mediapipe.solutions.hands;
+
+import android.graphics.Bitmap;
+import com.google.auto.value.AutoBuilder;
+import com.google.common.collect.ImmutableList;
+import com.google.mediapipe.formats.proto.LandmarkProto.NormalizedLandmarkList;
+import com.google.mediapipe.formats.proto.ClassificationProto.Classification;
+import com.google.mediapipe.framework.Packet;
+import com.google.mediapipe.framework.TextureFrame;
+import com.google.mediapipe.solutionbase.ImageSolutionResult;
+import java.util.List;
+
+/**
+ * HandsResult contains a collection of detected/tracked hands, a collection of handedness of the
+ * detected/tracked hands, and the input {@link Bitmap} or {@link TextureFrame}. If not in static
+ * image mode, the timestamp field will be set to the timestamp of the corresponding input image.
+ */
+public class HandsResult extends ImageSolutionResult {
+ private final ImmutableList