Skip to content

Commit 8116255

Browse files
committed
Remove location
Signed-off-by: Behrooz <[email protected]>
1 parent 633f4ec commit 8116255

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pathology/multiple_instance_learning/panda_mil_train_evaluate_pytorch_gpu.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
ScaleIntensityRanged,
3434
ToTensord,
3535
)
36-
from monai.transforms.spatial.array import GridPatch
37-
from monai.transforms.spatial.dictionary import GridPatchd
3836
from monai.networks.nets import milmodel
3937

4038

@@ -209,7 +207,7 @@ class LabelEncodeIntegerGraded(Transform):
209207
210208
"""
211209

212-
def __init__(self, num_classes, keys=["label"]):
210+
def __init__(self, num_classes, keys=("label",)):
213211
super().__init__()
214212
self.keys = keys
215213
self.num_classes = num_classes
@@ -238,7 +236,6 @@ def list_data_collate(batch: collections.abc.Sequence):
238236
for i, item in enumerate(batch):
239237
data = item[0]
240238
data["image"] = torch.stack([ix["image"] for ix in item], dim=0)
241-
data["patch"]['location'] = [ix["patch"]['location'] for ix in item]
242239
batch[i] = data
243240
return default_collate(batch)
244241

@@ -285,7 +282,7 @@ def main_worker(gpu, args):
285282
RandGridPatchd(
286283
keys=["image"],
287284
patch_size=(args.tile_size, args.tile_size),
288-
max_num_patches=args.tile_count,
285+
num_patches=args.tile_count,
289286
sort_key="min",
290287
pad_opts={"constant_values": 255},
291288
),

0 commit comments

Comments
 (0)