Skip to content

Commit

Permalink
Loading colors correctly
Browse files Browse the repository at this point in the history
#3 finished
  • Loading branch information
nesh committed Dec 6, 2020
1 parent 980c768 commit db3ae8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def copy_attributes(self, other: 'Image'):
@staticmethod
def load(path: Union[str, Path]):
img = cv2.imread(str(path))
bands = len(img.shape)
if(bands == 3):
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
return Image(img)

def __repr__(self):
Expand Down

0 comments on commit db3ae8d

Please sign in to comment.