Skip to content

Commit

Permalink
Merge pull request #159 from anwai98/aa-pannuke
Browse files Browse the repository at this point in the history
Add PanNuke Check Script
  • Loading branch information
constantinpape committed Oct 19, 2023
2 parents b8d9cd9 + dd98685 commit c697ea5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
20 changes: 20 additions & 0 deletions scripts/datasets/check_pannuke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from torch_em.util.debug import check_loader
from torch_em.data.datasets import get_pannuke_loader


PANNUKE_ROOT = "/scratch/usr/nimanwai/data/pannuke/"


def check_pannuke():
loader = get_pannuke_loader(
path=PANNUKE_ROOT,
batch_size=2,
patch_shape=(1, 512, 512),
ndim=2,
download=True
)
check_loader(loader, 8, instance_labels=True, plt=False, rgb=True)


if __name__ == "__main__":
check_pannuke()
16 changes: 0 additions & 16 deletions torch_em/data/datasets/pannuke.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from glob import glob

import torch_em
from torch_em.util.debug import check_loader
from torch_em.data.datasets import util


Expand Down Expand Up @@ -197,18 +196,3 @@ def get_pannuke_loader(
custom_label_choice=custom_label_choice,
**dataset_kwargs)
return torch_em.get_data_loader(ds, batch_size=batch_size, **loader_kwargs)


def main():
train_loader = get_pannuke_loader(
path="./pannuke/",
batch_size=2,
patch_shape=(1, 256, 256),
ndim=2,
download=True
)
check_loader(train_loader, 8, instance_labels=True, plt=False, rgb=True)


if __name__ == "__main__":
main()

0 comments on commit c697ea5

Please sign in to comment.