Skip to content

Commit

Permalink
Defect augmentations in cremi dataloader can now be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape committed Jul 4, 2023
1 parent 9bd75ae commit 6ef6819
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions torch_em/data/datasets/cremi.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_cremi_dataset(
data_paths.append(data_path)
data_rois.append(rois.get(name, np.s_[:, :, :]))

if "artifact_source" not in defect_augmentation_kwargs:
if defect_augmentation_kwargs is not None and "artifact_source" not in defect_augmentation_kwargs:
# download the defect volume
url = CREMI_URLS["defects"]
checksum = CHECKSUMS["defects"]
Expand All @@ -127,10 +127,11 @@ def get_cremi_dataset(
label_key = "volumes/labels/neuron_ids"

# defect augmentations
raw_transform = torch_em.transform.get_raw_transform(
augmentation1=torch_em.transform.EMDefectAugmentation(**defect_augmentation_kwargs)
)
update_kwargs(kwargs, "raw_transform", raw_transform)
if defect_augmentation_kwargs is not None:
raw_transform = torch_em.transform.get_raw_transform(
augmentation1=torch_em.transform.EMDefectAugmentation(**defect_augmentation_kwargs)
)
update_kwargs(kwargs, "raw_transform", raw_transform)

assert not ((offsets is not None) and boundaries)
if offsets is not None:
Expand Down

0 comments on commit 6ef6819

Please sign in to comment.