From 7c7eda89437fcc63cbb36d445098e5bd9e4c5f3a Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Thu, 25 Apr 2024 15:21:42 +0200 Subject: [PATCH] correct small bug --- src/main/java/ai/nets/samj/models/EfficientSamJ.java | 1 + src/main/java/ai/nets/samj/models/EfficientViTSamJ.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/ai/nets/samj/models/EfficientSamJ.java b/src/main/java/ai/nets/samj/models/EfficientSamJ.java index b734654..cc1fe52 100644 --- a/src/main/java/ai/nets/samj/models/EfficientSamJ.java +++ b/src/main/java/ai/nets/samj/models/EfficientSamJ.java @@ -393,6 +393,7 @@ protected & NativeType> void setImageOfInterest(Random long[] dims = rai.dimensionsAsLongArray(); if (dims.length == 2) rai = Views.addDimension(rai, 0, 0); + dims = rai.dimensionsAsLongArray(); if (dims[2] == 1) rai = Views.interval( Views.expandMirrorDouble(rai, new long[] {0, 0, 2}), Intervals.createMinMax(new long[] {0, 0, 0, dims[0] - 1, dims[1] - 1, 2}) ); diff --git a/src/main/java/ai/nets/samj/models/EfficientViTSamJ.java b/src/main/java/ai/nets/samj/models/EfficientViTSamJ.java index 5104ae1..6283e6a 100644 --- a/src/main/java/ai/nets/samj/models/EfficientViTSamJ.java +++ b/src/main/java/ai/nets/samj/models/EfficientViTSamJ.java @@ -303,6 +303,7 @@ protected & NativeType> void setImageOfInterest(Random long[] dims = rai.dimensionsAsLongArray(); if (dims.length == 2) rai = Views.addDimension(rai, 0, 0); + dims = rai.dimensionsAsLongArray(); if (dims[2] == 1) rai = Views.interval( Views.expandMirrorDouble(rai, new long[] {0, 0, 2}), Intervals.createMinMax(new long[] {0, 0, 0, dims[0] - 1, dims[1] - 1, 2}) );