From d16b539cce6787dda02ad00127498dcc5807ca0c Mon Sep 17 00:00:00 2001 From: Olivier Burri Date: Thu, 10 Feb 2022 16:23:52 +0100 Subject: [PATCH] Impoved support for logging when training cellpose (#6) * adds support for cellpose 1.0 * Bump cellpose version --- build.gradle | 2 +- src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java | 5 +++-- .../java/qupath/ext/biop/cellpose/CellposeExtension.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 96ea5e6..0151c41 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ ext.moduleName = 'qupath.extension.cellpose' description = 'QuPath extension to use Cellpose' -version = "0.3.2" +version = "0.3.3" dependencies { def qupathVersion = "0.3.2" // For now diff --git a/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java b/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java index 9430ce5..78a0ec8 100644 --- a/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java +++ b/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java @@ -583,8 +583,6 @@ public File train() { */ private void runCellposeTraining() throws IOException, InterruptedException { - //python -m cellpose --train --dir ~/images_cyto/train/ --test_dir ~/images_cyto/test/ --pretrained_model cyto --chan 2 --chan2 1 - // Create command to run VirtualEnvironmentRunner veRunner = new VirtualEnvironmentRunner(cellposeSetup.getEnvironmentNameOrPath(), cellposeSetup.getEnvironmentType(), this.getClass().getSimpleName() + "-train"); @@ -635,6 +633,9 @@ private void runCellposeTraining() throws IOException, InterruptedException { if (useGPU) cellposeArguments.add("--use_gpu"); + if (cellposeSetup.getVersion().equals(CellposeSetup.CellposeVersion.CELLPOSE_1)) + cellposeArguments.add("--verbose"); + veRunner.setArguments(cellposeArguments); // Finally, we can run Cellpose diff --git a/src/main/java/qupath/ext/biop/cellpose/CellposeExtension.java b/src/main/java/qupath/ext/biop/cellpose/CellposeExtension.java index 3373ac0..10a0dcb 100644 --- a/src/main/java/qupath/ext/biop/cellpose/CellposeExtension.java +++ b/src/main/java/qupath/ext/biop/cellpose/CellposeExtension.java @@ -86,6 +86,6 @@ public Version getQuPathVersion() { @Override public Version getVersion() { - return Version.parse("0.3.2"); + return Version.parse("0.3.3"); } } \ No newline at end of file