Skip to content

Commit 515f007

Browse files
committed
focus on fixing macos15-intel cp3 and cp4
1 parent dc3d50c commit 515f007

2 files changed

Lines changed: 44 additions & 3 deletions

File tree

src/main/resources/pixi.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ llvmlite = "*"
1919

2020
[pypi-dependencies]
2121
appose = ">=0.10.1, <0.12"
22-
numpy = "<2"
2322

2423
# --- PyTorch features ---
2524
# See for more details on torch versions and CUDA support: https://pytorch.org/get-started/previous-versions/
@@ -82,6 +81,8 @@ torchvision = { version = ">=0.17.2, <0.26", index = "https://download.pytorch.o
8281
# --- CellPose version features ---
8382
[feature.cp3.pypi-dependencies]
8483
cellpose = ">=3.1, <4"
84+
[feature.cp3.target.osx-64.pypi-dependencies]
85+
numpy = "<2"
8586

8687
[feature.cp4.pypi-dependencies]
8788
cellpose = ">=4, <5"

src/test/java/net/imglib2/cellpose/EnvironmentTest.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class EnvironmentTest
2424
{
2525

2626
@Test
27-
public void createEnvironment()
27+
public void createEnvironmentCP3()
2828
{
2929
int[] dims = new int[] { 300, 300 };
3030
try {
@@ -58,7 +58,47 @@ public void createEnvironment()
5858
}
5959
catch ( BuildException | IOException | InterruptedException | TaskException e )
6060
{
61-
Assert.fail("Got an exception when installing environment: "+e);
61+
Assert.fail("Got an exception when installing environment CP3: "+e);
62+
e.printStackTrace();
63+
}
64+
65+
}
66+
67+
@Test
68+
public void createEnvironmentCP4()
69+
{
70+
int[] dims = new int[] { 300, 300 };
71+
try {
72+
ShmImg<UnsignedByteType> shimg = new ShmImg<>( new UnsignedByteType(), dims );
73+
ShmImg<UnsignedByteType> shout = new ShmImg<>( new UnsignedByteType(), dims );
74+
75+
76+
final Cellpose4Parameters params = Cellpose4Parameters.builder()
77+
.model( Cellpose4BuiltinModels.CPSAM )
78+
.computeFlows( false )
79+
.build();
80+
final String envName = "cp4-cpu";
81+
final String pythonScriptPath = "/cp4.py";
82+
final String pythonInitScriptPath = "/cp4_init.py";
83+
84+
CellposeRunner<UnsignedByteType, UnsignedByteType> cprun = new CellposeRunner<>(
85+
params,
86+
pythonInitScriptPath,
87+
pythonScriptPath,
88+
envName,
89+
ApposeTaskListener.STD,
90+
shimg,
91+
AxisInfo.XY,
92+
shout,
93+
null );
94+
95+
cprun.init();
96+
cprun.close();
97+
98+
}
99+
catch ( BuildException | IOException | InterruptedException | TaskException e )
100+
{
101+
Assert.fail("Got an exception when installing environment CP4: "+e);
62102
e.printStackTrace();
63103
}
64104

0 commit comments

Comments
 (0)