Skip to content

Commit 4095215

Browse files
author
Stefan Hahmann
committed
Add stardist model selection
1 parent 9cc666e commit 4095215

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/java/org/mastodon/mamut/detection/StarDist.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ public StarDist( final ModelType model ) throws IOException, InterruptedExceptio
4545
if ( files != null && files.length > 0 )
4646
logger.debug( "Found {} files in {}", files.length, directory.getAbsolutePath() );
4747
else
48-
BioimageioRepo.connect().downloadByName( "StarDist Plant Nuclei 3D ResNet", directory.getAbsolutePath() );
48+
{
49+
try
50+
{
51+
logger.info( "Downloading model to {}", directory.getAbsolutePath() + File.separator + modelType.getModelName() );
52+
BioimageioRepo.connect().downloadByName( modelType.getModelName(), directory.getAbsolutePath() );
53+
}
54+
catch ( IllegalArgumentException e )
55+
{
56+
logger.info( "Exception while downloading model: {}", e.getMessage() );
57+
}
58+
}
4959
}
5060
else
5161
logger.error( "The specified path is not a directory: {}", directory.getAbsolutePath() );

0 commit comments

Comments
 (0)