|
20 | 20 | */
|
21 | 21 | package io.bioimage.modelrunner.pytorch;
|
22 | 22 |
|
| 23 | +import io.bioimage.modelrunner.bioimageio.BioimageioRepo; |
| 24 | +import io.bioimage.modelrunner.bioimageio.download.DownloadTracker; |
| 25 | +import io.bioimage.modelrunner.bioimageio.download.DownloadTracker.TwoParameterConsumer; |
23 | 26 | import io.bioimage.modelrunner.engine.DeepLearningEngineInterface;
|
24 | 27 | import io.bioimage.modelrunner.exceptions.LoadModelException;
|
25 | 28 | import io.bioimage.modelrunner.exceptions.RunModelException;
|
|
39 | 42 |
|
40 | 43 | import java.io.BufferedReader;
|
41 | 44 | import java.io.File;
|
42 |
| -import java.io.FileWriter; |
43 | 45 | import java.io.IOException;
|
44 | 46 | import java.io.InputStreamReader;
|
45 | 47 | import java.io.UnsupportedEncodingException;
|
@@ -568,13 +570,16 @@ private static String padSpecialJavaBin(String javaBin) {
|
568 | 570 | * @throws LoadModelException if there is any error loading the model
|
569 | 571 | * @throws IOException if there is any error reading or writing any file or with the paths
|
570 | 572 | * @throws RunModelException if there is any error running the model
|
| 573 | + * @throws InterruptedException |
571 | 574 | */
|
572 |
| - public static void main(String[] args) throws LoadModelException, IOException, RunModelException { |
| 575 | + public static void main(String[] args) throws LoadModelException, IOException, RunModelException, InterruptedException { |
573 | 576 | if (args.length == 0) {
|
574 |
| - |
575 |
| - String modelFolder = "C:\\Users\\carlos\\OneDrive\\Documentos\\pasteur\\git" |
576 |
| - + "\\deep-icy\\models\\MitchondriaEMSegmentation2D_31102023_214027"; |
577 |
| - String modelSourc = modelFolder + "\\weights-torchscript.pt"; |
| 577 | + // Create an instance of the BioimageRepo object |
| 578 | + BioimageioRepo br = BioimageioRepo.connect(); |
| 579 | + String aa = br.downloadByNickame("hiding-blowfish", "models"); |
| 580 | + |
| 581 | + String modelFolder = aa; |
| 582 | + String modelSourc = modelFolder + "/weights-torchscript.pt"; |
578 | 583 | PytorchInterface pi = new PytorchInterface();
|
579 | 584 | pi.loadModel(modelFolder, modelSourc);
|
580 | 585 | RandomAccessibleInterval<FloatType> rai = ArrayImgs.floats(new long[] {1, 1, 512, 512});
|
|
0 commit comments