Skip to content
Snippets Groups Projects
Commit 638e4b7d authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[data.segment.cxr8] Fixes mask loading

parent 61bba3de
No related branches found
No related tags found
1 merge request!64Add object detection
......@@ -53,7 +53,6 @@ import os
import pathlib
import typing
import numpy as np
import PIL.Image
import torch
from torchvision import tv_tensors
......@@ -159,10 +158,9 @@ class RawDataLoader(BaseDataLoader):
)
)
target = np.array(PIL.Image.open(self.datadir / target_path))
target = np.where(target == 255, 0, target)
target = PIL.Image.fromarray(np.array(target > 0))
target = PIL.Image.open(self.datadir / target_path).convert(
mode="1", dither=None
)
return to_dtype(to_image(target), torch.float32, scale=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment