Skip to content

Commit f35dbe4

Browse files
committed
Fixes weird recording behaviour with custom models in cellpose and omnipose
1 parent d0195b4 commit f35dbe4

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Diff for: src/main/java/ch/epfl/biop/wrappers/cellpose/ij2commands/Cellpose.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,17 @@ public void run() {
154154
settings.setEnvPath(env_path.toString());
155155
settings.setEnvType(env_type);
156156
settings.setDatasetDir(cellposeTempDir.toString());
157-
158-
if ( model==null || model.trim().isEmpty()){
159-
System.out.println("Using custom model");
160-
model = model_path.toString();
157+
String model_used = model;
158+
if (model==null || model.trim().isEmpty()){
159+
ls.info("Using cellpose custom model: "+model_path);
160+
model_used = model_path.toString();
161161
}
162-
settings.setModel(model);
162+
settings.setModel(model_used);
163163
settings.setDiameter(diameter);
164164
settings.setChannel1(ch1);
165-
if (ch2 > -1 ) settings.setChannel2(ch2);
165+
if (ch2 > -1) {
166+
settings.setChannel2(ch2);
167+
}
166168
settings.setAdditionalFlags(additional_flags);
167169

168170
// settings are done , so we can now process the imp with cellpose

Diff for: src/main/java/ch/epfl/biop/wrappers/omnipose/ij2commands/Omnipose.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ public void run() {
157157
settings.setEnvType(env_type);
158158
settings.setDatasetDir(omniposeTempDir.toString());
159159

160-
if ( model==null || model.trim().isEmpty()){
161-
System.out.println("Using custom model");
162-
model = model_path.toString();
160+
String model_used = model;
161+
if (model==null || model.trim().isEmpty()){
162+
ls.info("Using omnipose custom model: "+model_path);
163+
model_used = model_path.toString();
163164
}
164-
settings.setModel(model);
165+
settings.setModel(model_used);
165166
settings.setDiameter(diameter);
166167
settings.setChannel1(ch1);
167168
if (ch2 > -1 ) settings.setChannel2(ch2);

0 commit comments

Comments
 (0)