From c1d5c1160641dac313e6342bfdbad28e1a3cde6d Mon Sep 17 00:00:00 2001 From: YassineYousfi Date: Mon, 7 Dec 2020 14:18:36 -0500 Subject: [PATCH 1/2] Create LICENSE MIT --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1553548 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Yassine Yousfi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 4d75c933542a21c456e284dfd6179df021b207b1 Mon Sep 17 00:00:00 2001 From: YassineYousfi Date: Tue, 8 Dec 2020 19:15:08 -0500 Subject: [PATCH 2/2] Fixes #2 IAAPerspective corrupts the mask if not in {0;1} thanks @geohot --- retriever.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retriever.py b/retriever.py index 5efe907..8d2317c 100644 --- a/retriever.py +++ b/retriever.py @@ -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) @@ -95,4 +95,4 @@ def __getitem__(self, index: int): def __len__(self) -> int: return len(self.image_names) - \ No newline at end of file +