Skip to content

Commit 6c59ebd

Browse files
committed
do not use apple silicon yet and add TODO
1 parent 37ebc63 commit 6c59ebd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/ai/nets/samj/models/Sam2.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,15 @@ public class Sam2 extends AbstractSamJ {
7676
+ "measure.label(np.ones((10, 10)), connectivity=1)" + System.lineSeparator()
7777
+ "import torch" + System.lineSeparator()
7878
+ "device = 'cpu'" + System.lineSeparator()
79-
+ ((!IS_APPLE_SILICON) ? ""
79+
+ ((!IS_APPLE_SILICON && false) ? "" // TODO Add a button so the user can decide whether to use accelerators or not (I tried enabling by default and some models might be out of memory)
8080
: "from torch.backends import mps" + System.lineSeparator()
8181
+ "if mps.is_built() and mps.is_available():" + System.lineSeparator()
8282
+ " device = 'mps'" + System.lineSeparator())
83-
+ "print(device)" + System.lineSeparator()
8483
+ "from scipy.ndimage import binary_fill_holes" + System.lineSeparator()
8584
+ "from scipy.ndimage import label" + System.lineSeparator()
8685
+ "import sys" + System.lineSeparator()
8786
+ "import os" + System.lineSeparator()
8887
+ "import platform" + System.lineSeparator()
89-
+ "print(platform.platform())" + System.lineSeparator()
90-
+ "print(platform.machine())" + System.lineSeparator()
9188
+ "from multiprocessing import shared_memory" + System.lineSeparator()
9289
+ "from sam2.build_sam import build_sam2" + System.lineSeparator()
9390
+ "from sam2.sam2_image_predictor import SAM2ImagePredictor" + System.lineSeparator()

0 commit comments

Comments
 (0)