monai-weekly 1.4.dev2430__py3-none-any.whl → 1.4.dev2434__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- monai/__init__.py +1 -1
- monai/_version.py +3 -3
- monai/apps/generation/maisi/networks/autoencoderkl_maisi.py +43 -25
- monai/apps/generation/maisi/networks/controlnet_maisi.py +15 -18
- monai/apps/generation/maisi/networks/diffusion_model_unet_maisi.py +18 -18
- monai/bundle/config_parser.py +2 -2
- monai/bundle/reference_resolver.py +18 -1
- monai/bundle/scripts.py +45 -22
- monai/bundle/utils.py +3 -1
- monai/data/utils.py +1 -1
- monai/data/wsi_datasets.py +3 -3
- monai/losses/__init__.py +1 -0
- monai/losses/dice.py +10 -1
- monai/losses/nacl_loss.py +139 -0
- monai/networks/blocks/crossattention.py +48 -26
- monai/networks/blocks/mlp.py +16 -4
- monai/networks/blocks/selfattention.py +75 -23
- monai/networks/blocks/spatialattention.py +16 -1
- monai/networks/blocks/transformerblock.py +17 -2
- monai/networks/nets/__init__.py +2 -1
- monai/networks/nets/autoencoderkl.py +55 -22
- monai/networks/nets/cell_sam_wrapper.py +92 -0
- monai/networks/nets/controlnet.py +24 -22
- monai/networks/nets/diffusion_model_unet.py +159 -19
- monai/networks/nets/segresnet_ds.py +127 -1
- monai/networks/nets/spade_autoencoderkl.py +24 -2
- monai/networks/nets/spade_diffusion_model_unet.py +39 -2
- monai/networks/nets/transformer.py +17 -17
- monai/networks/nets/vista3d.py +908 -0
- monai/networks/utils.py +3 -3
- monai/transforms/__init__.py +1 -0
- monai/transforms/io/array.py +1 -1
- monai/transforms/post/array.py +2 -1
- monai/transforms/spatial/functional.py +1 -1
- monai/transforms/transform.py +2 -2
- monai/transforms/utils.py +183 -0
- monai/{apps/generation/maisi/utils/morphological_ops.py → transforms/utils_morphological_ops.py} +2 -0
- monai/transforms/utils_pytorch_numpy_unification.py +2 -2
- monai/utils/module.py +7 -6
- {monai_weekly-1.4.dev2430.dist-info → monai_weekly-1.4.dev2434.dist-info}/METADATA +83 -81
- {monai_weekly-1.4.dev2430.dist-info → monai_weekly-1.4.dev2434.dist-info}/RECORD +44 -41
- {monai_weekly-1.4.dev2430.dist-info → monai_weekly-1.4.dev2434.dist-info}/WHEEL +1 -1
- {monai_weekly-1.4.dev2430.dist-info → monai_weekly-1.4.dev2434.dist-info}/LICENSE +0 -0
- {monai_weekly-1.4.dev2430.dist-info → monai_weekly-1.4.dev2434.dist-info}/top_level.txt +0 -0
monai/networks/utils.py
CHANGED
@@ -822,7 +822,7 @@ def _onnx_trt_compile(
|
|
822
822
|
output_names = [] if not output_names else output_names
|
823
823
|
|
824
824
|
# set up the TensorRT builder
|
825
|
-
|
825
|
+
torch.cuda.set_device(device)
|
826
826
|
logger = trt.Logger(trt.Logger.WARNING)
|
827
827
|
builder = trt.Builder(logger)
|
828
828
|
network = builder.create_network(1 << int(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH))
|
@@ -931,7 +931,7 @@ def convert_to_trt(
|
|
931
931
|
warnings.warn(f"The dynamic batch range sequence should have 3 elements, but got {dynamic_batchsize} elements.")
|
932
932
|
|
933
933
|
device = device if device else 0
|
934
|
-
target_device = torch.device(f"cuda:{device}")
|
934
|
+
target_device = torch.device(f"cuda:{device}")
|
935
935
|
convert_precision = torch.float32 if precision == "fp32" else torch.half
|
936
936
|
inputs = [torch.rand(ensure_tuple(input_shape)).to(target_device)]
|
937
937
|
|
@@ -986,7 +986,7 @@ def convert_to_trt(
|
|
986
986
|
ir_model,
|
987
987
|
inputs=input_placeholder,
|
988
988
|
enabled_precisions=convert_precision,
|
989
|
-
device=
|
989
|
+
device=torch_tensorrt.Device(f"cuda:{device}"),
|
990
990
|
ir="torchscript",
|
991
991
|
**kwargs,
|
992
992
|
)
|
monai/transforms/__init__.py
CHANGED
monai/transforms/io/array.py
CHANGED
@@ -86,7 +86,7 @@ def switch_endianness(data, new="<"):
|
|
86
86
|
if new not in ("<", ">"):
|
87
87
|
raise NotImplementedError(f"Not implemented option new={new}.")
|
88
88
|
if current_ != new:
|
89
|
-
data = data.byteswap().newbyteorder(new)
|
89
|
+
data = data.byteswap().view(data.dtype.newbyteorder(new))
|
90
90
|
elif isinstance(data, tuple):
|
91
91
|
data = tuple(switch_endianness(x, new) for x in data)
|
92
92
|
elif isinstance(data, list):
|
monai/transforms/post/array.py
CHANGED
@@ -211,7 +211,8 @@ class AsDiscrete(Transform):
|
|
211
211
|
raise ValueError("`to_onehot=True/False` is deprecated, please use `to_onehot=num_classes` instead.")
|
212
212
|
img = convert_to_tensor(img, track_meta=get_track_meta())
|
213
213
|
img_t, *_ = convert_data_type(img, torch.Tensor)
|
214
|
-
|
214
|
+
argmax = self.argmax if argmax is None else argmax
|
215
|
+
if argmax:
|
215
216
|
img_t = torch.argmax(img_t, dim=self.kwargs.get("dim", 0), keepdim=self.kwargs.get("keepdim", True))
|
216
217
|
|
217
218
|
to_onehot = self.to_onehot if to_onehot is None else to_onehot
|
@@ -373,7 +373,7 @@ def rotate(img, angle, output_shape, mode, padding_mode, align_corners, dtype, l
|
|
373
373
|
if output_shape is None:
|
374
374
|
corners = np.asarray(np.meshgrid(*[(0, dim) for dim in im_shape], indexing="ij")).reshape((len(im_shape), -1))
|
375
375
|
corners = transform[:-1, :-1] @ corners # type: ignore
|
376
|
-
output_shape = np.asarray(
|
376
|
+
output_shape = np.asarray(np.ptp(corners, axis=1) + 0.5, dtype=int)
|
377
377
|
else:
|
378
378
|
output_shape = np.asarray(output_shape, dtype=int)
|
379
379
|
shift = create_translate(input_ndim, ((np.array(im_shape) - 1) / 2).tolist())
|
monai/transforms/transform.py
CHANGED
@@ -203,8 +203,8 @@ class Randomizable(ThreadUnsafe, RandomizableTrait):
|
|
203
203
|
|
204
204
|
"""
|
205
205
|
if seed is not None:
|
206
|
-
_seed = id(seed) if not isinstance(seed, (int, np.integer)) else seed
|
207
|
-
_seed = _seed % MAX_SEED
|
206
|
+
_seed = np.int64(id(seed) if not isinstance(seed, (int, np.integer)) else seed)
|
207
|
+
_seed = _seed % MAX_SEED # need to account for Numpy2.0 which doesn't silently convert to int64
|
208
208
|
self.R = np.random.RandomState(_seed)
|
209
209
|
return self
|
210
210
|
|
monai/transforms/utils.py
CHANGED
@@ -22,6 +22,7 @@ from typing import Any
|
|
22
22
|
|
23
23
|
import numpy as np
|
24
24
|
import torch
|
25
|
+
from torch import Tensor
|
25
26
|
|
26
27
|
import monai
|
27
28
|
from monai.config import DtypeLike, IndexSelection
|
@@ -30,6 +31,7 @@ from monai.networks.layers import GaussianFilter
|
|
30
31
|
from monai.networks.utils import meshgrid_ij
|
31
32
|
from monai.transforms.compose import Compose
|
32
33
|
from monai.transforms.transform import MapTransform, Transform, apply_transform
|
34
|
+
from monai.transforms.utils_morphological_ops import erode
|
33
35
|
from monai.transforms.utils_pytorch_numpy_unification import (
|
34
36
|
any_np_pt,
|
35
37
|
ascontiguousarray,
|
@@ -65,6 +67,8 @@ from monai.utils import (
|
|
65
67
|
min_version,
|
66
68
|
optional_import,
|
67
69
|
pytorch_after,
|
70
|
+
unsqueeze_left,
|
71
|
+
unsqueeze_right,
|
68
72
|
)
|
69
73
|
from monai.utils.enums import TransformBackends
|
70
74
|
from monai.utils.type_conversion import (
|
@@ -103,6 +107,8 @@ __all__ = [
|
|
103
107
|
"generate_spatial_bounding_box",
|
104
108
|
"get_extreme_points",
|
105
109
|
"get_largest_connected_component_mask",
|
110
|
+
"get_largest_connected_component_mask_point",
|
111
|
+
"convert_points_to_disc",
|
106
112
|
"remove_small_objects",
|
107
113
|
"img_bounds",
|
108
114
|
"in_bounds",
|
@@ -1172,6 +1178,183 @@ def get_largest_connected_component_mask(
|
|
1172
1178
|
return convert_to_dst_type(out, dst=img, dtype=out.dtype)[0]
|
1173
1179
|
|
1174
1180
|
|
1181
|
+
def get_largest_connected_component_mask_point(
|
1182
|
+
img_pos: NdarrayTensor,
|
1183
|
+
img_neg: NdarrayTensor,
|
1184
|
+
point_coords: NdarrayTensor,
|
1185
|
+
point_labels: NdarrayTensor,
|
1186
|
+
pos_val: Sequence[int] = (1, 3),
|
1187
|
+
neg_val: Sequence[int] = (0, 2),
|
1188
|
+
margins: int = 3,
|
1189
|
+
) -> NdarrayTensor:
|
1190
|
+
"""
|
1191
|
+
Gets the connected component of img_pos and img_neg that include the positive points and
|
1192
|
+
negative points separately. The function is used for combining automatic results with interactive
|
1193
|
+
results in VISTA3D.
|
1194
|
+
|
1195
|
+
Args:
|
1196
|
+
img_pos: bool type tensor, shape [B, 1, H, W, D], where B means the foreground masks from a single 3D image.
|
1197
|
+
img_neg: same format as img_pos but corresponds to negative points.
|
1198
|
+
pos_val: positive point label values.
|
1199
|
+
neg_val: negative point label values.
|
1200
|
+
point_coords: the coordinates of each point, shape [B, N, 3], where N means the number of points.
|
1201
|
+
point_labels: the label of each point, shape [B, N].
|
1202
|
+
"""
|
1203
|
+
|
1204
|
+
cucim_skimage, has_cucim = optional_import("cucim.skimage")
|
1205
|
+
|
1206
|
+
use_cp = has_cp and has_cucim and isinstance(img_pos, torch.Tensor) and img_pos.device != torch.device("cpu")
|
1207
|
+
if use_cp:
|
1208
|
+
img_pos_ = convert_to_cupy(img_pos.short()) # type: ignore
|
1209
|
+
img_neg_ = convert_to_cupy(img_neg.short()) # type: ignore
|
1210
|
+
label = cucim_skimage.measure.label
|
1211
|
+
lib = cp
|
1212
|
+
else:
|
1213
|
+
if not has_measure:
|
1214
|
+
raise RuntimeError("skimage.measure required.")
|
1215
|
+
img_pos_, *_ = convert_data_type(img_pos, np.ndarray)
|
1216
|
+
img_neg_, *_ = convert_data_type(img_neg, np.ndarray)
|
1217
|
+
# for skimage.measure.label, the input must be bool type
|
1218
|
+
if img_pos_.dtype != bool or img_neg_.dtype != bool:
|
1219
|
+
raise ValueError("img_pos and img_neg must be bool type.")
|
1220
|
+
label = measure.label
|
1221
|
+
lib = np
|
1222
|
+
|
1223
|
+
features_pos, _ = label(img_pos_, connectivity=3, return_num=True)
|
1224
|
+
features_neg, _ = label(img_neg_, connectivity=3, return_num=True)
|
1225
|
+
|
1226
|
+
outs = np.zeros_like(img_pos_)
|
1227
|
+
for bs in range(point_coords.shape[0]):
|
1228
|
+
for i, p in enumerate(point_coords[bs]):
|
1229
|
+
if point_labels[bs, i] in pos_val:
|
1230
|
+
features = features_pos
|
1231
|
+
elif point_labels[bs, i] in neg_val:
|
1232
|
+
features = features_neg
|
1233
|
+
else:
|
1234
|
+
# if -1 padding point, skip
|
1235
|
+
continue
|
1236
|
+
for margin in range(margins):
|
1237
|
+
if isinstance(p, np.ndarray):
|
1238
|
+
x, y, z = np.round(p).astype(int).tolist()
|
1239
|
+
else:
|
1240
|
+
x, y, z = p.float().round().int().tolist()
|
1241
|
+
l, r = max(x - margin, 0), min(x + margin + 1, features.shape[-3])
|
1242
|
+
t, d = max(y - margin, 0), min(y + margin + 1, features.shape[-2])
|
1243
|
+
f, b = max(z - margin, 0), min(z + margin + 1, features.shape[-1])
|
1244
|
+
if (features[bs, 0, l:r, t:d, f:b] > 0).any():
|
1245
|
+
index = features[bs, 0, l:r, t:d, f:b].max()
|
1246
|
+
outs[[bs]] += lib.isin(features[[bs]], index)
|
1247
|
+
break
|
1248
|
+
outs[outs > 1] = 1
|
1249
|
+
return convert_to_dst_type(outs, dst=img_pos, dtype=outs.dtype)[0]
|
1250
|
+
|
1251
|
+
|
1252
|
+
def convert_points_to_disc(
|
1253
|
+
image_size: Sequence[int], point: Tensor, point_label: Tensor, radius: int = 2, disc: bool = False
|
1254
|
+
):
|
1255
|
+
"""
|
1256
|
+
Convert a 3D point coordinates into image mask. The returned mask has the same spatial
|
1257
|
+
size as `image_size` while the batch dimension is the same as 'point' batch dimension.
|
1258
|
+
The point is converted to a mask ball with radius defined by `radius`. The output
|
1259
|
+
contains two channels each for negative (first channel) and positive points.
|
1260
|
+
|
1261
|
+
Args:
|
1262
|
+
image_size: The output size of the converted mask. It should be a 3D tuple.
|
1263
|
+
point: [B, N, 3], 3D point coordinates.
|
1264
|
+
point_label: [B, N], 0 or 2 means negative points, 1 or 3 means postive points.
|
1265
|
+
radius: disc ball radius size.
|
1266
|
+
disc: If true, use regular disc, other use gaussian.
|
1267
|
+
"""
|
1268
|
+
masks = torch.zeros([point.shape[0], 2, image_size[0], image_size[1], image_size[2]], device=point.device)
|
1269
|
+
_array = [
|
1270
|
+
torch.arange(start=0, end=image_size[i], step=1, dtype=torch.float32, device=point.device) for i in range(3)
|
1271
|
+
]
|
1272
|
+
coord_rows, coord_cols, coord_z = torch.meshgrid(_array[2], _array[1], _array[0])
|
1273
|
+
# [1, 3, h, w, d] -> [b, 2, 3, h, w, d]
|
1274
|
+
coords = unsqueeze_left(torch.stack((coord_rows, coord_cols, coord_z), dim=0), 6)
|
1275
|
+
coords = coords.repeat(point.shape[0], 2, 1, 1, 1, 1)
|
1276
|
+
for b, n in np.ndindex(*point.shape[:2]):
|
1277
|
+
point_bn = unsqueeze_right(point[b, n], 4)
|
1278
|
+
if point_label[b, n] > -1:
|
1279
|
+
channel = 0 if (point_label[b, n] == 0 or point_label[b, n] == 2) else 1
|
1280
|
+
pow_diff = torch.pow(coords[b, channel] - point_bn, 2)
|
1281
|
+
if disc:
|
1282
|
+
masks[b, channel] += pow_diff.sum(0) < radius**2
|
1283
|
+
else:
|
1284
|
+
masks[b, channel] += torch.exp(-pow_diff.sum(0) / (2 * radius**2))
|
1285
|
+
return masks
|
1286
|
+
|
1287
|
+
|
1288
|
+
def sample_points_from_label(
|
1289
|
+
labels: Tensor,
|
1290
|
+
label_set: Sequence[int],
|
1291
|
+
max_ppoint: int = 1,
|
1292
|
+
max_npoint: int = 0,
|
1293
|
+
device: torch.device | str | None = "cpu",
|
1294
|
+
use_center: bool = False,
|
1295
|
+
):
|
1296
|
+
"""Sample points from labels.
|
1297
|
+
|
1298
|
+
Args:
|
1299
|
+
labels: [1, 1, H, W, D]
|
1300
|
+
label_set: local index, must match values in labels.
|
1301
|
+
max_ppoint: maximum positive point samples.
|
1302
|
+
max_npoint: maximum negative point samples.
|
1303
|
+
device: returned tensor device.
|
1304
|
+
use_center: whether to sample points from center.
|
1305
|
+
|
1306
|
+
Returns:
|
1307
|
+
point: point coordinates of [B, N, 3]. B equals to the length of label_set.
|
1308
|
+
point_label: [B, N], always 0 for negative, 1 for positive.
|
1309
|
+
"""
|
1310
|
+
if not labels.shape[0] == 1:
|
1311
|
+
raise ValueError("labels must have batch size 1.")
|
1312
|
+
|
1313
|
+
if device is None:
|
1314
|
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
1315
|
+
|
1316
|
+
labels = labels[0, 0]
|
1317
|
+
unique_labels = labels.unique().cpu().numpy().tolist()
|
1318
|
+
_point = []
|
1319
|
+
_point_label = []
|
1320
|
+
for id in label_set:
|
1321
|
+
if id in unique_labels:
|
1322
|
+
plabels = labels == int(id)
|
1323
|
+
nlabels = ~plabels
|
1324
|
+
_plabels = get_largest_connected_component_mask(erode(plabels.unsqueeze(0).unsqueeze(0))[0, 0])
|
1325
|
+
plabelpoints = torch.nonzero(_plabels).to(device)
|
1326
|
+
if len(plabelpoints) == 0:
|
1327
|
+
plabelpoints = torch.nonzero(plabels).to(device)
|
1328
|
+
nlabelpoints = torch.nonzero(nlabels).to(device)
|
1329
|
+
num_p = min(len(plabelpoints), max_ppoint)
|
1330
|
+
num_n = min(len(nlabelpoints), max_npoint)
|
1331
|
+
pad = max_ppoint + max_npoint - num_p - num_n
|
1332
|
+
if use_center:
|
1333
|
+
pmean = plabelpoints.float().mean(0)
|
1334
|
+
pdis = ((plabelpoints - pmean) ** 2).sum(-1)
|
1335
|
+
_, sorted_indices_tensor = torch.sort(pdis)
|
1336
|
+
sorted_indices = sorted_indices_tensor.cpu().tolist()
|
1337
|
+
else:
|
1338
|
+
sorted_indices = list(range(len(plabelpoints)))
|
1339
|
+
random.shuffle(sorted_indices)
|
1340
|
+
_point.append(
|
1341
|
+
torch.stack(
|
1342
|
+
[plabelpoints[sorted_indices[i]] for i in range(num_p)]
|
1343
|
+
+ random.choices(nlabelpoints, k=num_n)
|
1344
|
+
+ [torch.tensor([0, 0, 0], device=device)] * pad
|
1345
|
+
)
|
1346
|
+
)
|
1347
|
+
_point_label.append(torch.tensor([1] * num_p + [0] * num_n + [-1] * pad).to(device))
|
1348
|
+
else:
|
1349
|
+
# pad the background labels
|
1350
|
+
_point.append(torch.zeros(max_ppoint + max_npoint, 3).to(device))
|
1351
|
+
_point_label.append(torch.zeros(max_ppoint + max_npoint).to(device) - 1)
|
1352
|
+
point = torch.stack(_point)
|
1353
|
+
point_label = torch.stack(_point_label)
|
1354
|
+
|
1355
|
+
return point, point_label
|
1356
|
+
|
1357
|
+
|
1175
1358
|
def remove_small_objects(
|
1176
1359
|
img: NdarrayTensor,
|
1177
1360
|
min_size: int = 64,
|
monai/{apps/generation/maisi/utils/morphological_ops.py → transforms/utils_morphological_ops.py}
RENAMED
@@ -20,6 +20,8 @@ from torch import Tensor
|
|
20
20
|
from monai.config import NdarrayOrTensor
|
21
21
|
from monai.utils import convert_data_type, convert_to_dst_type, ensure_tuple_rep
|
22
22
|
|
23
|
+
__all__ = ["erode", "dilate"]
|
24
|
+
|
23
25
|
|
24
26
|
def erode(mask: NdarrayOrTensor, filter_size: int | Sequence[int] = 3, pad_value: float = 1.0) -> NdarrayOrTensor:
|
25
27
|
"""
|
@@ -480,7 +480,7 @@ def max(x: NdarrayTensor, dim: int | tuple | None = None, **kwargs) -> NdarrayTe
|
|
480
480
|
else:
|
481
481
|
ret = torch.max(x, int(dim), **kwargs) # type: ignore
|
482
482
|
|
483
|
-
return ret
|
483
|
+
return ret[0] if isinstance(ret, tuple) else ret
|
484
484
|
|
485
485
|
|
486
486
|
def mean(x: NdarrayTensor, dim: int | tuple | None = None, **kwargs) -> NdarrayTensor:
|
@@ -546,7 +546,7 @@ def min(x: NdarrayTensor, dim: int | tuple | None = None, **kwargs) -> NdarrayTe
|
|
546
546
|
else:
|
547
547
|
ret = torch.min(x, int(dim), **kwargs) # type: ignore
|
548
548
|
|
549
|
-
return ret
|
549
|
+
return ret[0] if isinstance(ret, tuple) else ret
|
550
550
|
|
551
551
|
|
552
552
|
def std(x: NdarrayTensor, dim: int | tuple | None = None, unbiased: bool = False) -> NdarrayTensor:
|
monai/utils/module.py
CHANGED
@@ -13,7 +13,6 @@ from __future__ import annotations
|
|
13
13
|
|
14
14
|
import enum
|
15
15
|
import functools
|
16
|
-
import importlib.util
|
17
16
|
import os
|
18
17
|
import pdb
|
19
18
|
import re
|
@@ -209,10 +208,11 @@ def load_submodules(
|
|
209
208
|
):
|
210
209
|
if (is_pkg or load_all) and name not in sys.modules and match(exclude_pattern, name) is None:
|
211
210
|
try:
|
211
|
+
mod = import_module(name)
|
212
212
|
mod_spec = importer.find_spec(name) # type: ignore
|
213
213
|
if mod_spec and mod_spec.loader:
|
214
|
-
|
215
|
-
|
214
|
+
loader = mod_spec.loader
|
215
|
+
loader.exec_module(mod)
|
216
216
|
submodules.append(mod)
|
217
217
|
except OptionalImportError:
|
218
218
|
pass # could not import the optional deps., they are ignored
|
@@ -564,7 +564,7 @@ def version_leq(lhs: str, rhs: str) -> bool:
|
|
564
564
|
"""
|
565
565
|
|
566
566
|
lhs, rhs = str(lhs), str(rhs)
|
567
|
-
pkging, has_ver = optional_import("
|
567
|
+
pkging, has_ver = optional_import("packaging.Version")
|
568
568
|
if has_ver:
|
569
569
|
try:
|
570
570
|
return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs))
|
@@ -591,7 +591,8 @@ def version_geq(lhs: str, rhs: str) -> bool:
|
|
591
591
|
|
592
592
|
"""
|
593
593
|
lhs, rhs = str(lhs), str(rhs)
|
594
|
-
pkging, has_ver = optional_import("
|
594
|
+
pkging, has_ver = optional_import("packaging.Version")
|
595
|
+
|
595
596
|
if has_ver:
|
596
597
|
try:
|
597
598
|
return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))
|
@@ -629,7 +630,7 @@ def pytorch_after(major: int, minor: int, patch: int = 0, current_ver_string: st
|
|
629
630
|
if current_ver_string is None:
|
630
631
|
_env_var = os.environ.get("PYTORCH_VER", "")
|
631
632
|
current_ver_string = _env_var if _env_var else torch.__version__
|
632
|
-
ver, has_ver = optional_import("
|
633
|
+
ver, has_ver = optional_import("packaging.version", name="parse")
|
633
634
|
if has_ver:
|
634
635
|
return ver(".".join((f"{major}", f"{minor}", f"{patch}"))) <= ver(f"{current_ver_string}") # type: ignore
|
635
636
|
parts = f"{current_ver_string}".split("+", 1)[0].split(".", 3)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: monai-weekly
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.dev2434
|
4
4
|
Summary: AI Toolkit for Healthcare Imaging
|
5
5
|
Home-page: https://monai.io/
|
6
6
|
Author: MONAI Consortium
|
@@ -29,125 +29,127 @@ Classifier: Typing :: Typed
|
|
29
29
|
Requires-Python: >=3.9
|
30
30
|
Description-Content-Type: text/markdown; charset=UTF-8
|
31
31
|
License-File: LICENSE
|
32
|
-
Requires-Dist: torch
|
33
|
-
Requires-Dist: numpy
|
32
|
+
Requires-Dist: torch>=1.9
|
33
|
+
Requires-Dist: numpy<2.0,>=1.24
|
34
34
|
Provides-Extra: all
|
35
|
-
Requires-Dist: nibabel
|
36
|
-
Requires-Dist: ninja
|
37
|
-
Requires-Dist: scikit-image
|
38
|
-
Requires-Dist: pillow
|
39
|
-
Requires-Dist: tensorboard
|
40
|
-
Requires-Dist: gdown
|
41
|
-
Requires-Dist: pytorch-ignite
|
42
|
-
Requires-Dist: torchvision
|
43
|
-
Requires-Dist: itk
|
44
|
-
Requires-Dist: tqdm
|
45
|
-
Requires-Dist: lmdb
|
46
|
-
Requires-Dist: psutil
|
47
|
-
Requires-Dist: openslide-python
|
48
|
-
Requires-Dist: tifffile
|
49
|
-
Requires-Dist: imagecodecs
|
50
|
-
Requires-Dist: pandas
|
51
|
-
Requires-Dist: einops
|
52
|
-
Requires-Dist: mlflow
|
53
|
-
Requires-Dist: clearml
|
54
|
-
Requires-Dist: matplotlib
|
55
|
-
Requires-Dist: tensorboardX
|
56
|
-
Requires-Dist: pyyaml
|
57
|
-
Requires-Dist: fire
|
58
|
-
Requires-Dist: jsonschema
|
59
|
-
Requires-Dist: pynrrd
|
60
|
-
Requires-Dist: pydicom
|
61
|
-
Requires-Dist: h5py
|
62
|
-
Requires-Dist: nni
|
63
|
-
Requires-Dist: optuna
|
64
|
-
Requires-Dist: onnx
|
65
|
-
Requires-Dist: zarr
|
66
|
-
Requires-Dist: lpips
|
67
|
-
Requires-Dist: nvidia-ml-py
|
68
|
-
Requires-Dist: huggingface-hub
|
69
|
-
Requires-Dist: pyamg
|
70
|
-
Requires-Dist: transformers
|
71
|
-
Requires-Dist: onnxruntime
|
72
|
-
Requires-Dist: scipy
|
73
|
-
Requires-Dist: cucim-cu12
|
35
|
+
Requires-Dist: nibabel; extra == "all"
|
36
|
+
Requires-Dist: ninja; extra == "all"
|
37
|
+
Requires-Dist: scikit-image>=0.14.2; extra == "all"
|
38
|
+
Requires-Dist: pillow; extra == "all"
|
39
|
+
Requires-Dist: tensorboard; extra == "all"
|
40
|
+
Requires-Dist: gdown>=4.7.3; extra == "all"
|
41
|
+
Requires-Dist: pytorch-ignite==0.4.11; extra == "all"
|
42
|
+
Requires-Dist: torchvision; extra == "all"
|
43
|
+
Requires-Dist: itk>=5.2; extra == "all"
|
44
|
+
Requires-Dist: tqdm>=4.47.0; extra == "all"
|
45
|
+
Requires-Dist: lmdb; extra == "all"
|
46
|
+
Requires-Dist: psutil; extra == "all"
|
47
|
+
Requires-Dist: openslide-python; extra == "all"
|
48
|
+
Requires-Dist: tifffile; extra == "all"
|
49
|
+
Requires-Dist: imagecodecs; extra == "all"
|
50
|
+
Requires-Dist: pandas; extra == "all"
|
51
|
+
Requires-Dist: einops; extra == "all"
|
52
|
+
Requires-Dist: mlflow>=2.12.2; extra == "all"
|
53
|
+
Requires-Dist: clearml>=1.10.0rc0; extra == "all"
|
54
|
+
Requires-Dist: matplotlib>=3.6.3; extra == "all"
|
55
|
+
Requires-Dist: tensorboardX; extra == "all"
|
56
|
+
Requires-Dist: pyyaml; extra == "all"
|
57
|
+
Requires-Dist: fire; extra == "all"
|
58
|
+
Requires-Dist: jsonschema; extra == "all"
|
59
|
+
Requires-Dist: pynrrd; extra == "all"
|
60
|
+
Requires-Dist: pydicom; extra == "all"
|
61
|
+
Requires-Dist: h5py; extra == "all"
|
62
|
+
Requires-Dist: nni; extra == "all"
|
63
|
+
Requires-Dist: optuna; extra == "all"
|
64
|
+
Requires-Dist: onnx>=1.13.0; extra == "all"
|
65
|
+
Requires-Dist: zarr; extra == "all"
|
66
|
+
Requires-Dist: lpips==0.1.4; extra == "all"
|
67
|
+
Requires-Dist: nvidia-ml-py; extra == "all"
|
68
|
+
Requires-Dist: huggingface-hub; extra == "all"
|
69
|
+
Requires-Dist: pyamg>=5.0.0; extra == "all"
|
70
|
+
Requires-Dist: transformers<4.41.0,>=4.36.0; python_version <= "3.10" and extra == "all"
|
71
|
+
Requires-Dist: onnxruntime; python_version <= "3.10" and extra == "all"
|
72
|
+
Requires-Dist: scipy>=1.12.0; python_version >= "3.9" and extra == "all"
|
73
|
+
Requires-Dist: cucim-cu12; (python_version >= "3.9" and python_version <= "3.10") and extra == "all"
|
74
74
|
Provides-Extra: clearml
|
75
|
-
Requires-Dist: clearml
|
75
|
+
Requires-Dist: clearml; extra == "clearml"
|
76
76
|
Provides-Extra: cucim
|
77
|
-
Requires-Dist: cucim-cu12
|
77
|
+
Requires-Dist: cucim-cu12; extra == "cucim"
|
78
78
|
Provides-Extra: einops
|
79
|
-
Requires-Dist: einops
|
79
|
+
Requires-Dist: einops; extra == "einops"
|
80
80
|
Provides-Extra: fire
|
81
|
-
Requires-Dist: fire
|
81
|
+
Requires-Dist: fire; extra == "fire"
|
82
82
|
Provides-Extra: gdown
|
83
|
-
Requires-Dist: gdown
|
83
|
+
Requires-Dist: gdown>=4.7.3; extra == "gdown"
|
84
84
|
Provides-Extra: h5py
|
85
|
-
Requires-Dist: h5py
|
85
|
+
Requires-Dist: h5py; extra == "h5py"
|
86
86
|
Provides-Extra: huggingface_hub
|
87
|
-
Requires-Dist: huggingface-hub
|
87
|
+
Requires-Dist: huggingface-hub; extra == "huggingface-hub"
|
88
88
|
Provides-Extra: ignite
|
89
|
-
Requires-Dist: pytorch-ignite
|
89
|
+
Requires-Dist: pytorch-ignite==0.4.11; extra == "ignite"
|
90
90
|
Provides-Extra: imagecodecs
|
91
|
-
Requires-Dist: imagecodecs
|
91
|
+
Requires-Dist: imagecodecs; extra == "imagecodecs"
|
92
92
|
Provides-Extra: itk
|
93
|
-
Requires-Dist: itk
|
93
|
+
Requires-Dist: itk>=5.2; extra == "itk"
|
94
94
|
Provides-Extra: jsonschema
|
95
|
-
Requires-Dist: jsonschema
|
95
|
+
Requires-Dist: jsonschema; extra == "jsonschema"
|
96
96
|
Provides-Extra: lmdb
|
97
|
-
Requires-Dist: lmdb
|
97
|
+
Requires-Dist: lmdb; extra == "lmdb"
|
98
98
|
Provides-Extra: lpips
|
99
|
-
Requires-Dist: lpips
|
99
|
+
Requires-Dist: lpips==0.1.4; extra == "lpips"
|
100
100
|
Provides-Extra: matplotlib
|
101
|
-
Requires-Dist: matplotlib
|
101
|
+
Requires-Dist: matplotlib>=3.6.3; extra == "matplotlib"
|
102
102
|
Provides-Extra: mlflow
|
103
|
-
Requires-Dist: mlflow
|
103
|
+
Requires-Dist: mlflow>=2.12.2; extra == "mlflow"
|
104
104
|
Provides-Extra: nibabel
|
105
|
-
Requires-Dist: nibabel
|
105
|
+
Requires-Dist: nibabel; extra == "nibabel"
|
106
106
|
Provides-Extra: ninja
|
107
|
-
Requires-Dist: ninja
|
107
|
+
Requires-Dist: ninja; extra == "ninja"
|
108
108
|
Provides-Extra: nni
|
109
|
-
Requires-Dist: nni
|
109
|
+
Requires-Dist: nni; extra == "nni"
|
110
110
|
Provides-Extra: onnx
|
111
|
-
Requires-Dist: onnx
|
112
|
-
Requires-Dist: onnxruntime
|
111
|
+
Requires-Dist: onnx>=1.13.0; extra == "onnx"
|
112
|
+
Requires-Dist: onnxruntime; python_version <= "3.10" and extra == "onnx"
|
113
113
|
Provides-Extra: openslide
|
114
|
-
Requires-Dist: openslide-python
|
114
|
+
Requires-Dist: openslide-python; extra == "openslide"
|
115
115
|
Provides-Extra: optuna
|
116
|
-
Requires-Dist: optuna
|
116
|
+
Requires-Dist: optuna; extra == "optuna"
|
117
|
+
Provides-Extra: packaging
|
118
|
+
Requires-Dist: packaging; extra == "packaging"
|
117
119
|
Provides-Extra: pandas
|
118
|
-
Requires-Dist: pandas
|
120
|
+
Requires-Dist: pandas; extra == "pandas"
|
119
121
|
Provides-Extra: pillow
|
120
|
-
Requires-Dist: pillow
|
122
|
+
Requires-Dist: pillow!=8.3.0; extra == "pillow"
|
121
123
|
Provides-Extra: psutil
|
122
|
-
Requires-Dist: psutil
|
124
|
+
Requires-Dist: psutil; extra == "psutil"
|
123
125
|
Provides-Extra: pyamg
|
124
|
-
Requires-Dist: pyamg
|
126
|
+
Requires-Dist: pyamg>=5.0.0; extra == "pyamg"
|
125
127
|
Provides-Extra: pydicom
|
126
|
-
Requires-Dist: pydicom
|
128
|
+
Requires-Dist: pydicom; extra == "pydicom"
|
127
129
|
Provides-Extra: pynrrd
|
128
|
-
Requires-Dist: pynrrd
|
130
|
+
Requires-Dist: pynrrd; extra == "pynrrd"
|
129
131
|
Provides-Extra: pynvml
|
130
|
-
Requires-Dist: nvidia-ml-py
|
132
|
+
Requires-Dist: nvidia-ml-py; extra == "pynvml"
|
131
133
|
Provides-Extra: pyyaml
|
132
|
-
Requires-Dist: pyyaml
|
134
|
+
Requires-Dist: pyyaml; extra == "pyyaml"
|
133
135
|
Provides-Extra: scipy
|
134
|
-
Requires-Dist: scipy
|
136
|
+
Requires-Dist: scipy>=1.12.0; python_version >= "3.9" and extra == "scipy"
|
135
137
|
Provides-Extra: skimage
|
136
|
-
Requires-Dist: scikit-image
|
138
|
+
Requires-Dist: scikit-image>=0.14.2; extra == "skimage"
|
137
139
|
Provides-Extra: tensorboard
|
138
|
-
Requires-Dist: tensorboard
|
140
|
+
Requires-Dist: tensorboard; extra == "tensorboard"
|
139
141
|
Provides-Extra: tensorboardx
|
140
|
-
Requires-Dist: tensorboardX
|
142
|
+
Requires-Dist: tensorboardX; extra == "tensorboardx"
|
141
143
|
Provides-Extra: tifffile
|
142
|
-
Requires-Dist: tifffile
|
144
|
+
Requires-Dist: tifffile; extra == "tifffile"
|
143
145
|
Provides-Extra: torchvision
|
144
|
-
Requires-Dist: torchvision
|
146
|
+
Requires-Dist: torchvision; extra == "torchvision"
|
145
147
|
Provides-Extra: tqdm
|
146
|
-
Requires-Dist: tqdm
|
148
|
+
Requires-Dist: tqdm>=4.47.0; extra == "tqdm"
|
147
149
|
Provides-Extra: transformers
|
148
|
-
Requires-Dist: transformers
|
150
|
+
Requires-Dist: transformers<4.41.0,>=4.36.0; python_version <= "3.10" and extra == "transformers"
|
149
151
|
Provides-Extra: zarr
|
150
|
-
Requires-Dist: zarr
|
152
|
+
Requires-Dist: zarr; extra == "zarr"
|
151
153
|
|
152
154
|
<p align="center">
|
153
155
|
<img src="https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/docs/images/MONAI-logo-color.png" width="50%" alt='project-monai'>
|