Skip to content

Commit 23ffb93

Browse files
committed
adapt for macro recording
1 parent caeb26c commit 23ffb93

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/java/ai/nets/samj/gui/MainGUI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@ protected < T extends RealType< T > & NativeType< T > > void batchSAMize() {
540540
consumer.setFocusedImage(this.cmbImages.getSelectedObject());
541541
new Thread(() -> {
542542
try {
543-
consumer.notifyBatchSamize();
543+
consumer.notifyBatchSamize(this.cmbModels.getSelectedModel().getName(),
544+
rai == null ? null : consumer.getFocusedImageName() );
544545
cmbModels.getSelectedModel().processBatchOfPrompts(pointPrompts, rectPrompts, rai, batchDrawerCallback);
545546
} catch (IOException | RuntimeException | InterruptedException e) {
546547
e.printStackTrace();

src/main/java/ai/nets/samj/ui/ConsumerInterface.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public interface ConsumerCallback {
8080

8181
public abstract Object getFocusedImage();
8282

83+
public abstract String getFocusedImageName();
84+
8385
public abstract < T extends RealType< T > & NativeType< T > > RandomAccessibleInterval<T> getFocusedImageAsRai();
8486

8587
public abstract List<int[]> getPointRoisOnFocusImage();
@@ -104,8 +106,13 @@ public interface ConsumerCallback {
104106

105107
/**
106108
* Notify when the user has clicked on the button batchSAMIZe
109+
*
110+
* @param modelName
111+
* the model that is going to be used
112+
* @param maskPrompt
113+
* the name of the image that contained the prompts wanted
107114
*/
108-
public abstract void notifyBatchSamize();
115+
public abstract void notifyBatchSamize(String modelName, String maskPrompt);
109116

110117
public void setModel(SAMModel model) {
111118
this.selectedModel = model;

0 commit comments

Comments
 (0)