@@ -278,9 +278,17 @@ private void unzipTfWeights(ModelDescriptor descriptor) throws LoadModelExceptio
278
278
String source = descriptor .getWeights ().gettAllSupportedWeightObjects ().stream ()
279
279
.filter (ww -> ww .getFramework ().equals (EngineInfo .getBioimageioTfKey ()))
280
280
.findFirst ().get ().getSource ();
281
- source = DownloadModel .getFileNameFromURLString (source );
282
- System .out .println ("Unzipping model..." );
283
- ZipUtils .unzipFolder (modelFolder + File .separator + source , modelFolder );
281
+ if (new File (source ).isFile ()) {
282
+ System .out .println ("Unzipping model..." );
283
+ ZipUtils .unzipFolder (new File (source ).getAbsolutePath (), modelFolder );
284
+ } else if (new File (modelFolder , source ).isFile ()) {
285
+ System .out .println ("Unzipping model..." );
286
+ ZipUtils .unzipFolder (new File (modelFolder , source ).getAbsolutePath (), modelFolder );
287
+ } else {
288
+ source = DownloadModel .getFileNameFromURLString (source );
289
+ System .out .println ("Unzipping model..." );
290
+ ZipUtils .unzipFolder (modelFolder + File .separator + source , modelFolder );
291
+ }
284
292
} else {
285
293
throw new LoadModelException ("No model file was found in the model folder" );
286
294
}
@@ -498,6 +506,9 @@ public static String getModelOutputName(String outputName, int i) {
498
506
* @throws RunModelException if there is any error running the model
499
507
*/
500
508
public static void main (String [] args ) throws LoadModelException , IOException , RunModelException {
509
+ Tensorflow2Interface tt = new Tensorflow2Interface (false );
510
+
511
+ tt .loadModel ("/home/carlos/Desktop/Fiji.app/models/model_03bioimageio" , null );
501
512
// Unpack the args needed
502
513
if (args .length < 4 )
503
514
throw new IllegalArgumentException ("Error exectuting Tensorflow 2, "
0 commit comments