Skip to content

Commit 3ca1b08

Browse files
committed
remove methods that save a npy array
1 parent 87ffcbd commit 3ca1b08

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/main/java/io/bioimage/modelrunner/pytorch/PytorchInterface.java

-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import io.bioimage.modelrunner.engine.DeepLearningEngineInterface;
2828
import io.bioimage.modelrunner.exceptions.LoadModelException;
2929
import io.bioimage.modelrunner.exceptions.RunModelException;
30-
import io.bioimage.modelrunner.numpy.DecodeNumpy;
3130
import io.bioimage.modelrunner.pytorch.shm.ShmBuilder;
3231
import io.bioimage.modelrunner.pytorch.shm.TensorBuilder;
3332
import io.bioimage.modelrunner.pytorch.tensor.ImgLib2Builder;
@@ -60,7 +59,6 @@
6059
import java.util.LinkedList;
6160
import java.util.List;
6261
import java.util.Map;
63-
import java.util.UUID;
6462

6563
import com.google.gson.Gson;
6664

@@ -276,7 +274,6 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
276274
for (String ee : inputs) {
277275
Map<String, Object> decoded = Types.decode(ee);
278276
SharedMemoryArray shma = SharedMemoryArray.read((String) decoded.get(MEM_NAME_KEY));
279-
DecodeNumpy.saveNpy("/home/carlos/git/mm_in" + UUID.randomUUID().toString() + ".npy", Cast.unchecked(shma.getSharedRAI()));
280277
NDArray inT = TensorBuilder.build(shma, manager);
281278
if (PlatformDetection.isWindows()) shma.close();
282279
inputList.add(inT);

src/main/java/io/bioimage/modelrunner/pytorch/shm/ShmBuilder.java

-4
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,19 @@
2020
*/
2121
package io.bioimage.modelrunner.pytorch.shm;
2222

23-
import io.bioimage.modelrunner.numpy.DecodeNumpy;
2423
import io.bioimage.modelrunner.system.PlatformDetection;
2524
import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
2625
import io.bioimage.modelrunner.utils.CommonUtils;
2726

2827
import java.io.IOException;
2928
import java.util.Arrays;
30-
import java.util.UUID;
3129

3230
import ai.djl.ndarray.NDArray;
3331
import net.imglib2.type.numeric.integer.IntType;
3432
import net.imglib2.type.numeric.integer.LongType;
3533
import net.imglib2.type.numeric.integer.UnsignedByteType;
3634
import net.imglib2.type.numeric.real.DoubleType;
3735
import net.imglib2.type.numeric.real.FloatType;
38-
import net.imglib2.util.Cast;
3936

4037
/**
4138
* A utility class that converts {@link NDArray}s into {@link SharedMemoryArray}s for
@@ -117,7 +114,6 @@ private static void buildFromTensorFloat(NDArray tensor, String memoryName) thro
117114

118115
SharedMemoryArray shma = SharedMemoryArray.readOrCreate(memoryName, arrayShape, new FloatType(), false, true);
119116
shma.getDataBufferNoHeader().put(tensor.toByteArray());
120-
DecodeNumpy.saveNpy("/home/carlos/git/mm_out" + UUID.randomUUID().toString() + ".npy", Cast.unchecked(shma.getSharedRAI()));
121117
if (PlatformDetection.isWindows()) shma.close();
122118
}
123119

0 commit comments

Comments
 (0)