Skip to content

Commit

Permalink
adapt engine to persistent interprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Sep 24, 2024
1 parent 99ae780 commit 3ca0f15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
import io.bioimage.modelrunner.system.PlatformDetection;
import io.bioimage.modelrunner.tensor.Tensor;
import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
import io.bioimage.modelrunner.tensorflow.v2.api050.shm.ShmBuilder;
import io.bioimage.modelrunner.tensorflow.v2.api050.tensor.ImgLib2Builder;
import io.bioimage.modelrunner.tensorflow.v2.api050.tensor.TensorBuilder;
import io.bioimage.modelrunner.tensorflow.v2.api050.tensor.mappedbuffer.ImgLib2ToMappedBuffer;
import io.bioimage.modelrunner.tensorflow.v2.api050.tensor.mappedbuffer.MappedBufferToImgLib2;
import io.bioimage.modelrunner.utils.CommonUtils;
import io.bioimage.modelrunner.utils.Constants;
import io.bioimage.modelrunner.utils.ZipUtils;
Expand All @@ -50,24 +49,14 @@
import net.imglib2.util.Cast;
import net.imglib2.util.Util;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.ProtectionDomain;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -312,7 +301,7 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO
for (String ee : inputs) {
Map<String, Object> decoded = Types.decode(ee);
SharedMemoryArray shma = SharedMemoryArray.read((String) decoded.get(MEM_NAME_KEY));
TType inT = io.bioimage.modelrunner.tensorflow.v2.api030.shm.TensorBuilder.build(shma);
TType inT = io.bioimage.modelrunner.tensorflow.v2.api050.shm.TensorBuilder.build(shma);
if (PlatformDetection.isWindows()) shma.close();
inTensors.add(inT);
String inputName = getModelInputName((String) decoded.get(NAME_KEY), c ++);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* limitations under the License.
* #L%
*/
package io.bioimage.modelrunner.tensorflow.v2.api030.shm;
package io.bioimage.modelrunner.tensorflow.v2.api050.shm;

import io.bioimage.modelrunner.system.PlatformDetection;
import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* #L%
*/

package io.bioimage.modelrunner.tensorflow.v2.api030.shm;
package io.bioimage.modelrunner.tensorflow.v2.api050.shm;

import io.bioimage.modelrunner.tensor.shm.SharedMemoryArray;
import io.bioimage.modelrunner.utils.CommonUtils;
Expand Down

0 comments on commit 3ca0f15

Please sign in to comment.