Skip to content

Commit

Permalink
Fixes #2
Browse files Browse the repository at this point in the history
IAAPerspective corrupts the mask if not in {0;1} thanks @geohot
  • Loading branch information
YassineYousfi authored Dec 9, 2020
1 parent c1d5c11 commit 4d75c93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __getitem__(self, index: int):
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

mask = cv2.imread(str(self.data_path/self.masks_folder/image_name), 0)
mask = np.stack([(mask == v) for v in self.class_values], axis=-1).astype('float')
mask = np.stack([(mask == v) for v in self.class_values], axis=-1).astype('uint8')

if self.transforms:
sample = self.transforms(image=image, mask=mask)
Expand All @@ -95,4 +95,4 @@ def __getitem__(self, index: int):
def __len__(self) -> int:
return len(self.image_names)



0 comments on commit 4d75c93

Please sign in to comment.