From bda2639376d3a2fb19e40f9de007323d50c9abe9 Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Tue, 28 Mar 2023 12:18:09 -0700 Subject: [PATCH] Switch to use the `isPresent()` API since the `isEmpty()` is only available since java 11: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html#isEmpty(). PiperOrigin-RevId: 520099308 --- .../tasks/vision/facelandmarker/FaceLandmarkerResult.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/facelandmarker/FaceLandmarkerResult.java b/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/facelandmarker/FaceLandmarkerResult.java index 6493a6b5f..bafa40e19 100644 --- a/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/facelandmarker/FaceLandmarkerResult.java +++ b/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/facelandmarker/FaceLandmarkerResult.java @@ -57,7 +57,7 @@ public abstract class FaceLandmarkerResult implements TaskResult { } } Optional>> multiFaceBlendshapes = Optional.empty(); - if (!multiFaceBendshapesProto.isEmpty()) { + if (multiFaceBendshapesProto.isPresent()) { List> blendshapes = new ArrayList<>(); for (ClassificationList faceBendshapeProto : multiFaceBendshapesProto.get()) { List blendshape = new ArrayList<>(); @@ -74,7 +74,7 @@ public abstract class FaceLandmarkerResult implements TaskResult { multiFaceBlendshapes = Optional.of(Collections.unmodifiableList(blendshapes)); } Optional> multiFaceTransformationMatrixes = Optional.empty(); - if (!multiFaceTransformationMatrixesProto.isEmpty()) { + if (multiFaceTransformationMatrixesProto.isPresent()) { List matrixes = new ArrayList<>(); for (MatrixData matrixProto : multiFaceTransformationMatrixesProto.get()) { if (matrixProto.getPackedDataCount() != 16) {