-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from constantinpape/expose-get-dataset
Implement get_dataset for more datasets
- Loading branch information
Showing
9 changed files
with
203 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from torch_em.data.datasets import get_livecell_loader | ||
from torch_em.util.debug import check_loader | ||
|
||
LIVECELL_ROOT = "/home/pape/Work/data/incu_cyte/livecell" | ||
|
||
|
||
def check_livecell(): | ||
loader = get_livecell_loader(LIVECELL_ROOT, "train", (512, 512), 1) | ||
check_loader(loader, 15, instance_labels=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_livecell() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from torch_em.data.datasets import get_neurips_cellseg_supervised_loader | ||
from torch_em.util.debug import check_loader | ||
|
||
NEURIPS_ROOT = "/home/pape/Work/data/neurips-cell-seg" | ||
|
||
|
||
def check_neurips(): | ||
loader = get_neurips_cellseg_supervised_loader(NEURIPS_ROOT, "train", (512, 512), 1) | ||
check_loader(loader, 15, instance_labels=True, rgb=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_neurips() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import numpy as np | ||
from torch_em.transform.raw import standardize, normalize_percentile | ||
|
||
from torch_em.data.datasets import get_tissuenet_loader | ||
from torch_em.util.debug import check_loader | ||
|
||
TISSUENET_ROOT = "/home/pape/Work/data/tissuenet" | ||
|
||
|
||
def raw_trafo(raw): | ||
raw = normalize_percentile(raw, axis=(1, 2)) | ||
raw = np.mean(raw, axis=0) | ||
raw = standardize(raw) | ||
return raw | ||
|
||
|
||
# NOTE: the tissuenet data cannot be downloaded automatically. | ||
# you need to download it yourself from https://datasets.deepcell.org/data | ||
def check_tissuenet(): | ||
# set this path to where you have downloaded the tissuenet data | ||
loader = get_tissuenet_loader( | ||
TISSUENET_ROOT, "train", raw_channel="rgb", label_channel="cell", | ||
patch_shape=(512, 512), batch_size=1, shuffle=True, | ||
raw_transform=raw_trafo | ||
) | ||
check_loader(loader, 15, instance_labels=True, rgb=False) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_tissuenet() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.