Skip to content

Commit

Permalink
deprecate old env manager
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Aug 7, 2024
1 parent fc89712 commit 26330ab
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@
* and dependencies
*
* @author Carlos Javier Garcia Lopez de Haro
*
* @deprecated in favour of {@link SamEnvManagerAbstract}
*/
public class SamEnvManager_old {
@Deprecated
public class SamEnvManager {
/**
* Name of the file that contains the weights of SAM Huge
*/
Expand Down Expand Up @@ -221,7 +224,7 @@ public class SamEnvManager_old {
* the path where the corresponding micromamba shuold be installed
* @return an instance of {@link SamEnvManager}
*/
public static SamEnvManager_old create(String path) {
public static SamEnvManager create(String path) {
return create(path, (ss) -> {});
}

Expand All @@ -235,8 +238,8 @@ public static SamEnvManager_old create(String path) {
* an specific consumer where info about the installation is going to be communicated
* @return an instance of {@link SamEnvManager}
*/
public static SamEnvManager_old create(String path, Consumer<String> consumer) {
SamEnvManager_old installer = new SamEnvManager_old();
public static SamEnvManager create(String path, Consumer<String> consumer) {
SamEnvManager installer = new SamEnvManager();
installer.path = path;
installer.consumer = consumer;
installer.mamba = new Mamba(path);
Expand All @@ -249,7 +252,7 @@ public static SamEnvManager_old create(String path, Consumer<String> consumer) {
* Micromamba does not need to be installed as the code will install it automatically.
* @return an instance of {@link SamEnvManager}
*/
public static SamEnvManager_old create() {
public static SamEnvManager create() {
return create(DEFAULT_DIR);
}

Expand All @@ -261,7 +264,7 @@ public static SamEnvManager_old create() {
* an specific consumer where info about the installation is going to be communicated
* @return an instance of {@link SamEnvManager}
*/
public static SamEnvManager_old create(Consumer<String> consumer) {
public static SamEnvManager create(Consumer<String> consumer) {
return create(DEFAULT_DIR, consumer);
}

Expand Down Expand Up @@ -442,7 +445,7 @@ public void downloadESAMSmallWeights(boolean force) throws IOException, Interrup
String zipResourcePath = "efficient_sam_vits.pt.zip";
String outputDirectory = Paths.get(path, "envs", ESAM_ENV_NAME, ESAM_NAME, "weights").toFile().getAbsolutePath();
try (
InputStream zipInputStream = SamEnvManager_old.class.getClassLoader().getResourceAsStream(zipResourcePath);
InputStream zipInputStream = SamEnvManager.class.getClassLoader().getResourceAsStream(zipResourcePath);
ZipInputStream zipInput = new ZipInputStream(zipInputStream);
) {
ZipEntry entry;
Expand Down Expand Up @@ -743,7 +746,7 @@ private void installApposePackage(String envName, boolean force) throws IOExcept
String zipResourcePath = "appose-python.zip";
String outputDirectory = mamba.getEnvsDir() + File.separator + envName;
try (
InputStream zipInputStream = SamEnvManager_old.class.getClassLoader().getResourceAsStream(zipResourcePath);
InputStream zipInputStream = SamEnvManager.class.getClassLoader().getResourceAsStream(zipResourcePath);
ZipInputStream zipInput = new ZipInputStream(zipInputStream);
) {
ZipEntry entry;
Expand Down Expand Up @@ -810,7 +813,7 @@ public void installSAMPackage(boolean force) throws IOException, InterruptedExce
String zipResourcePath = "SAM.zip";
String outputDirectory = mamba.getEnvsDir() + File.separator + SAM_ENV_NAME + File.separator + SAM_NAME;
try (
InputStream zipInputStream = SamEnvManager_old.class.getResourceAsStream(zipResourcePath);
InputStream zipInputStream = SamEnvManager.class.getResourceAsStream(zipResourcePath);
ZipInputStream zipInput = new ZipInputStream(zipInputStream);
) {
ZipEntry entry;
Expand Down Expand Up @@ -873,7 +876,7 @@ public void installEfficientSAMPackage(boolean force) throws IOException, Interr
String zipResourcePath = "EfficientSAM.zip";
String outputDirectory = mamba.getEnvsDir() + File.separator + ESAM_ENV_NAME;
try (
InputStream zipInputStream = SamEnvManager_old.class.getClassLoader().getResourceAsStream(zipResourcePath);
InputStream zipInputStream = SamEnvManager.class.getClassLoader().getResourceAsStream(zipResourcePath);
ZipInputStream zipInput = new ZipInputStream(zipInputStream);
) {
ZipEntry entry;
Expand Down Expand Up @@ -931,7 +934,7 @@ public void installEfficientViTSAMPackage(boolean force) throws IOException, Int
String zipResourcePath = "efficientvit.zip";
String outputDirectory = mamba.getEnvsDir() + File.separator + EVITSAM_ENV_NAME;
try (
InputStream zipInputStream = SamEnvManager_old.class.getClassLoader().getResourceAsStream(zipResourcePath);
InputStream zipInputStream = SamEnvManager.class.getClassLoader().getResourceAsStream(zipResourcePath);
ZipInputStream zipInput = new ZipInputStream(zipInputStream);
) {
ZipEntry entry;
Expand Down

0 comments on commit 26330ab

Please sign in to comment.