Skip to content

Commit

Permalink
remove unnecessary exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 21, 2024
1 parent 01e44f2 commit ce39183
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ public void error(String text) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientSAM() throws IOException, RuntimeException, InterruptedException {
public EfficientSAM() {
this.manager = EfficientSamEnvManager.create();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ public void setInstalled(boolean installed) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientViTSAML0() throws IOException, RuntimeException, InterruptedException {
public EfficientViTSAML0() {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l0");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ public void setInstalled(boolean installed) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientViTSAML1() throws IOException, RuntimeException, InterruptedException {
public EfficientViTSAML1() {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l1");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ public void setInstalled(boolean installed) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientViTSAML2() throws IOException, RuntimeException, InterruptedException {
public EfficientViTSAML2() {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "l2");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ public void setInstalled(boolean installed) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientViTSAMXL0() throws IOException, RuntimeException, InterruptedException {
public EfficientViTSAMXL0() {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "xl0");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,8 @@ public void setInstalled(boolean installed) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public EfficientViTSAMXL1() throws IOException, RuntimeException, InterruptedException {
public EfficientViTSAMXL1() {
this.manager = EfficientViTSamEnvManager.create(EfficientViTSamEnvManager.DEFAULT_DIR, "xl1");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ public void error(String text) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public SAM2Large() throws IOException, RuntimeException, InterruptedException {
public SAM2Large() {
this.manager = Sam2EnvManager.create(Sam2EnvManager.DEFAULT_DIR, "large");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ public void error(String text) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public SAM2Small() throws IOException, RuntimeException, InterruptedException {
public SAM2Small() {
this.manager = Sam2EnvManager.create(Sam2EnvManager.DEFAULT_DIR, "small");
}

Expand Down
5 changes: 1 addition & 4 deletions src/main/java/ai/nets/samj/communication/model/SAM2Tiny.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ public void error(String text) {

/**
* Create an instance of the model that loads the model and encodes an image
* @throws IOException if any of the files to run a Python process is missing
* @throws RuntimeException if there is any error running the Python code
* @throws InterruptedException if the process is interrupted
*/
public SAM2Tiny() throws IOException, RuntimeException, InterruptedException {
public SAM2Tiny() {
this.manager = Sam2EnvManager.create(Sam2EnvManager.DEFAULT_DIR, "tiny");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
package ai.nets.samj.communication.model;

import java.io.IOException;
import java.util.ArrayList;

/**
Expand All @@ -31,11 +30,8 @@ public class SAMModels extends ArrayList<SAMModel> {

/**
* A list where each of the components is a {@link SAMModel}
* @throws InterruptedException if the thread where the models run is abruptly interrupted
* @throws RuntimeException if there is any error running the models
* @throws IOException if any of the files needed to run or load the models is missing
*/
public SAMModels() throws IOException, RuntimeException, InterruptedException {
public SAMModels() {
super();
add(new SAM2Tiny());
add(new SAM2Small());
Expand Down

0 comments on commit ce39183

Please sign in to comment.