Skip to content

Commit

Permalink
correct small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Apr 25, 2024
1 parent 2480c69 commit 7c7eda8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/ai/nets/samj/models/EfficientSamJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ protected <T extends RealType<T> & NativeType<T>> 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}) );
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ai/nets/samj/models/EfficientViTSamJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ protected <T extends RealType<T> & NativeType<T>> 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}) );
Expand Down

0 comments on commit 7c7eda8

Please sign in to comment.