Closed cmanzo closed 7 months ago
Should be possible with
im_pipeline = dt.LoadImage(raw_sources.path) >> dt.NormalizeMinMax()
lab_pipeline = dt.LoadImage(label_sources.path) >> dt.Lambda(select_labels, class_labels=[255, 191])
pipeline = (
(im_pipeline & lab_pipeline)
>> dt.FlipLR(raw_sources.flip_lr)
>> dt.FlipUD(raw_sources.flip_ud)
>> dt.MoveAxis(2, 0)
>> dt.pytorch.ToTensor(dtype=torch.float)
)
For dt.Crop
, nice catch, I will fix it
@cmanzo the issue with crops should be fixed. Can you confirm?
@BenjaminMidtvedt Crop works but if applied to a joined pipeline, it applies different cropping to the image pair. Is there an easy fix?
Should be fixed now.
I'm trying to figure out a way to deal with the UNet example and the ssTEM dataset using
dt.sources
. Segmented and raw images are in different folders and I'm trying to have a pipeline that does parallel operations on corresponding images of both folders.I couldn'f find a way to do that with dt.Dataset, so I've solved it using a pytorch dataset but I'm not sure is the most efficient way:
The Paths are created with dt.sources to allow dt.Flip:
and the pipeline is formed by the two below:
Is this the only way to achieve it?
An important point is that I haven't been able to include within or outside the pipeline is the dt.Crop, 'cause I get
AttributeError: 'numpy.ndarray' object has no attribute 'properties'
I thought it was because ofdt.config.disable_image_wrapper()
but it doesn't seem to be the case.