diff --git a/mediapipe/tasks/java/com/google/mediapipe/tasks/text/textclassifier/TextClassifier.java b/mediapipe/tasks/java/com/google/mediapipe/tasks/text/textclassifier/TextClassifier.java index 0ebffe7cf..76117d2e4 100644 --- a/mediapipe/tasks/java/com/google/mediapipe/tasks/text/textclassifier/TextClassifier.java +++ b/mediapipe/tasks/java/com/google/mediapipe/tasks/text/textclassifier/TextClassifier.java @@ -31,7 +31,6 @@ import com.google.mediapipe.tasks.core.TaskOptions; import com.google.mediapipe.tasks.core.TaskRunner; import com.google.mediapipe.tasks.core.proto.BaseOptionsProto; import com.google.mediapipe.tasks.text.textclassifier.proto.TextClassifierGraphOptionsProto; -import com.google.protobuf.InvalidProtocolBufferException; import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -154,7 +153,7 @@ public final class TextClassifier implements AutoCloseable { packets.get(CLASSIFICATION_RESULT_OUT_STREAM_INDEX), ClassificationsProto.ClassificationResult.getDefaultInstance()), packets.get(CLASSIFICATION_RESULT_OUT_STREAM_INDEX).getTimestamp()); - } catch (InvalidProtocolBufferException e) { + } catch (IOException e) { throw new MediaPipeException( MediaPipeException.StatusCode.INTERNAL.ordinal(), e.getMessage()); } diff --git a/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/imageclassifier/ImageClassifier.java b/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/imageclassifier/ImageClassifier.java index 68cae151f..e8e263b71 100644 --- a/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/imageclassifier/ImageClassifier.java +++ b/mediapipe/tasks/java/com/google/mediapipe/tasks/vision/imageclassifier/ImageClassifier.java @@ -39,7 +39,6 @@ import com.google.mediapipe.tasks.core.proto.BaseOptionsProto; import com.google.mediapipe.tasks.vision.core.BaseVisionTaskApi; import com.google.mediapipe.tasks.vision.core.RunningMode; import com.google.mediapipe.tasks.vision.imageclassifier.proto.ImageClassifierGraphOptionsProto; -import com.google.protobuf.InvalidProtocolBufferException; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; @@ -176,7 +175,7 @@ public final class ImageClassifier extends BaseVisionTaskApi { packets.get(CLASSIFICATION_RESULT_OUT_STREAM_INDEX), ClassificationsProto.ClassificationResult.getDefaultInstance()), packets.get(CLASSIFICATION_RESULT_OUT_STREAM_INDEX).getTimestamp()); - } catch (InvalidProtocolBufferException e) { + } catch (IOException e) { throw new MediaPipeException( MediaPipeException.StatusCode.INTERNAL.ordinal(), e.getMessage()); }