Skip to content

Commit

Permalink
do not initailize model until installed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Aug 7, 2024
1 parent 00d55cc commit 5751cc9
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class EfficientSAM implements SAMModel {
*/
public EfficientSAM() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientSamEnvManager.create();
efficientSamJ = EfficientSamJ.initializeSam(manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public void setInstalled(boolean installed) {
*/
public EfficientViTSAML0() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l0");
efficientSamJ = EfficientViTSamJ.initializeSam("l0", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public void setInstalled(boolean installed) {
*/
public EfficientViTSAML1() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l1");
efficientSamJ = EfficientViTSamJ.initializeSam("l1", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public void setInstalled(boolean installed) {
*/
public EfficientViTSAML2() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l2");
efficientSamJ = EfficientViTSamJ.initializeSam("l2", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public void setInstalled(boolean installed) {
*/
public EfficientViTSAMXL0() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "xl0");
efficientSamJ = EfficientViTSamJ.initializeSam("xl0", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public void setInstalled(boolean installed) {
*/
public EfficientViTSAMXL1() throws IOException, RuntimeException, InterruptedException {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "xl1");
efficientSamJ = EfficientViTSamJ.initializeSam("xl1", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class SAM2Small implements SAMModel {
*/
public SAM2Small() throws IOException, RuntimeException, InterruptedException {
this.manager = Sam2EnvManager.create(Sam2EnvManager.DEFAULT_DIR, "small");
efficientSamJ = Sam2.initializeSam("small", manager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class SAM2Tiny implements SAMModel {
*/
public SAM2Tiny() throws IOException, RuntimeException, InterruptedException {
this.manager = Sam2EnvManager.create(Sam2EnvManager.DEFAULT_DIR, "tiny");
efficientSamJ = Sam2.initializeSam("tiny", manager);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ai/nets/samj/communication/model/SAMModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class SAMModels extends ArrayList<SAMModel> {
public SAMModels() throws IOException, RuntimeException, InterruptedException {
super();
add(new EfficientSAM());
add(new EfficientViTSAML0());
add(new EfficientViTSAML1());
add(new SAM2Tiny());
add(new SAM2Small());
add(new EfficientViTSAML2());
add(new EfficientViTSAMXL0());
add(new EfficientViTSAMXL1());
//add(new EfficientViTSAMXL1());
}
}

0 comments on commit 5751cc9

Please sign in to comment.