diff --git a/src/main/java/fiji/plugin/trackmate/detector/lacss/LacssDetectorFactory.java b/src/main/java/fiji/plugin/trackmate/detector/lacss/LacssDetectorFactory.java index 5b8dd2c..ba320b6 100644 --- a/src/main/java/fiji/plugin/trackmate/detector/lacss/LacssDetectorFactory.java +++ b/src/main/java/fiji/plugin/trackmate/detector/lacss/LacssDetectorFactory.java @@ -165,9 +165,12 @@ private void addOnShutdownHook() public void run() { // new File(pyFilePath).delete(); - new File(modelPath).delete(); - - if (pyServer.isAlive()) { + if (settings.get(KEY_LACSS_MODEL) == PretrainedModel.Default) + { + new File(modelPath).delete(); + } + if (pyServer.isAlive()) + { pyServer.destroy(); } }